
(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 16 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 (log y) x (+ (fma y i z) (+ a t))) (* (log c) (- b 0.5))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(log(y), x, (fma(y, i, z) + (a + t))) + (log(c) * (b - 0.5));
}
function code(x, y, z, t, a, b, c, i) return Float64(fma(log(y), x, Float64(fma(y, i, z) + Float64(a + t))) + Float64(log(c) * Float64(b - 0.5))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[Log[y], $MachinePrecision] * x + N[(N[(y * i + z), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) + \log c \cdot \left(b - 0.5\right)
\end{array}
Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in c around inf 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
*-commutative99.9%
log-rec99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
distribute-neg-in99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -5e+153) (not (<= x 3e+243))) (+ (* (log y) x) (+ t (+ z (+ (* y i) (* (log c) -0.5))))) (+ (* y i) (+ (+ a (+ z t)) (* (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 <= -5e+153) || !(x <= 3e+243)) {
tmp = (log(y) * x) + (t + (z + ((y * i) + (log(c) * -0.5))));
} else {
tmp = (y * i) + ((a + (z + t)) + (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 <= (-5d+153)) .or. (.not. (x <= 3d+243))) then
tmp = (log(y) * x) + (t + (z + ((y * i) + (log(c) * (-0.5d0)))))
else
tmp = (y * i) + ((a + (z + t)) + (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 <= -5e+153) || !(x <= 3e+243)) {
tmp = (Math.log(y) * x) + (t + (z + ((y * i) + (Math.log(c) * -0.5))));
} else {
tmp = (y * i) + ((a + (z + t)) + (Math.log(c) * (b - 0.5)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -5e+153) or not (x <= 3e+243): tmp = (math.log(y) * x) + (t + (z + ((y * i) + (math.log(c) * -0.5)))) else: tmp = (y * i) + ((a + (z + t)) + (math.log(c) * (b - 0.5))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -5e+153) || !(x <= 3e+243)) tmp = Float64(Float64(log(y) * x) + Float64(t + Float64(z + Float64(Float64(y * i) + Float64(log(c) * -0.5))))); else tmp = Float64(Float64(y * i) + Float64(Float64(a + Float64(z + t)) + 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 <= -5e+153) || ~((x <= 3e+243))) tmp = (log(y) * x) + (t + (z + ((y * i) + (log(c) * -0.5)))); else tmp = (y * i) + ((a + (z + t)) + (log(c) * (b - 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -5e+153], N[Not[LessEqual[x, 3e+243]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+153} \lor \neg \left(x \leq 3 \cdot 10^{+243}\right):\\
\;\;\;\;\log y \cdot x + \left(t + \left(z + \left(y \cdot i + \log c \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\
\end{array}
\end{array}
if x < -5.00000000000000018e153 or 2.99999999999999984e243 < x Initial program 99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
associate-+l+99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in a around 0 86.8%
Taylor expanded in b around 0 84.3%
if -5.00000000000000018e153 < x < 2.99999999999999984e243Initial program 99.9%
Taylor expanded in x around 0 94.9%
Final simplification92.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log y) x)))
(if (<= y 5.5e-54)
(+ (+ a (+ t_1 (+ z t))) (* (log c) (- b 0.5)))
(+ (* y i) (+ (+ a (+ t (+ z t_1))) (* (log c) b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(y) * x;
double tmp;
if (y <= 5.5e-54) {
tmp = (a + (t_1 + (z + t))) + (log(c) * (b - 0.5));
} else {
tmp = (y * i) + ((a + (t + (z + t_1))) + (log(c) * b));
}
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(y) * x
if (y <= 5.5d-54) then
tmp = (a + (t_1 + (z + t))) + (log(c) * (b - 0.5d0))
else
tmp = (y * i) + ((a + (t + (z + t_1))) + (log(c) * b))
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(y) * x;
double tmp;
if (y <= 5.5e-54) {
tmp = (a + (t_1 + (z + t))) + (Math.log(c) * (b - 0.5));
} else {
tmp = (y * i) + ((a + (t + (z + t_1))) + (Math.log(c) * b));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = math.log(y) * x tmp = 0 if y <= 5.5e-54: tmp = (a + (t_1 + (z + t))) + (math.log(c) * (b - 0.5)) else: tmp = (y * i) + ((a + (t + (z + t_1))) + (math.log(c) * b)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(y) * x) tmp = 0.0 if (y <= 5.5e-54) tmp = Float64(Float64(a + Float64(t_1 + Float64(z + t))) + Float64(log(c) * Float64(b - 0.5))); else tmp = Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + t_1))) + Float64(log(c) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = log(y) * x; tmp = 0.0; if (y <= 5.5e-54) tmp = (a + (t_1 + (z + t))) + (log(c) * (b - 0.5)); else tmp = (y * i) + ((a + (t + (z + t_1))) + (log(c) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, 5.5e-54], N[(N[(a + N[(t$95$1 + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;y \leq 5.5 \cdot 10^{-54}:\\
\;\;\;\;\left(a + \left(t_1 + \left(z + t\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(a + \left(t + \left(z + t_1\right)\right)\right) + \log c \cdot b\right)\\
\end{array}
\end{array}
if y < 5.50000000000000046e-54Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in c around inf 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
*-commutative99.9%
log-rec99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
distribute-neg-in99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
if 5.50000000000000046e-54 < y Initial program 99.9%
Taylor expanded in b around inf 97.7%
Final simplification98.6%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ a (+ t (+ z (* (log y) x)))) (* (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 + (log(y) * x)))) + (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 + (log(y) * x)))) + (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 + (Math.log(y) * x)))) + (Math.log(c) * (b - 0.5))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return ((a + (t + (z + (math.log(y) * x)))) + (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(log(y) * x)))) + 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 + (log(y) * x)))) + (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[(N[Log[y], $MachinePrecision] * x), $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 + \log y \cdot x\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\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 (<= y 1.22e-135) (- (+ a (+ (* (log y) x) (+ z t))) (* (log c) 0.5)) (+ (* y i) (+ (+ a (+ z t)) (* (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 (y <= 1.22e-135) {
tmp = (a + ((log(y) * x) + (z + t))) - (log(c) * 0.5);
} else {
tmp = (y * i) + ((a + (z + t)) + (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 (y <= 1.22d-135) then
tmp = (a + ((log(y) * x) + (z + t))) - (log(c) * 0.5d0)
else
tmp = (y * i) + ((a + (z + t)) + (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 (y <= 1.22e-135) {
tmp = (a + ((Math.log(y) * x) + (z + t))) - (Math.log(c) * 0.5);
} else {
tmp = (y * i) + ((a + (z + t)) + (Math.log(c) * (b - 0.5)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 1.22e-135: tmp = (a + ((math.log(y) * x) + (z + t))) - (math.log(c) * 0.5) else: tmp = (y * i) + ((a + (z + t)) + (math.log(c) * (b - 0.5))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 1.22e-135) tmp = Float64(Float64(a + Float64(Float64(log(y) * x) + Float64(z + t))) - Float64(log(c) * 0.5)); else tmp = Float64(Float64(y * i) + Float64(Float64(a + Float64(z + t)) + 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 (y <= 1.22e-135) tmp = (a + ((log(y) * x) + (z + t))) - (log(c) * 0.5); else tmp = (y * i) + ((a + (z + t)) + (log(c) * (b - 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 1.22e-135], N[(N[(a + N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Log[c], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.22 \cdot 10^{-135}:\\
\;\;\;\;\left(a + \left(\log y \cdot x + \left(z + t\right)\right)\right) - \log c \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\
\end{array}
\end{array}
if y < 1.22e-135Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in c around inf 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
*-commutative99.9%
log-rec99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
distribute-neg-in99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in b around 0 88.1%
if 1.22e-135 < y Initial program 99.9%
Taylor expanded in x around 0 87.8%
Final simplification87.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (+ z t))))
(if (or (<= i -7.8e-15) (not (<= i 8.8e-51)))
(+ (* y i) (+ (* (log c) -0.5) t_1))
(+ t_1 (* (log c) (- b 0.5))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (z + t);
double tmp;
if ((i <= -7.8e-15) || !(i <= 8.8e-51)) {
tmp = (y * i) + ((log(c) * -0.5) + t_1);
} else {
tmp = t_1 + (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) :: t_1
real(8) :: tmp
t_1 = a + (z + t)
if ((i <= (-7.8d-15)) .or. (.not. (i <= 8.8d-51))) then
tmp = (y * i) + ((log(c) * (-0.5d0)) + t_1)
else
tmp = t_1 + (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 t_1 = a + (z + t);
double tmp;
if ((i <= -7.8e-15) || !(i <= 8.8e-51)) {
tmp = (y * i) + ((Math.log(c) * -0.5) + t_1);
} else {
tmp = t_1 + (Math.log(c) * (b - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (z + t) tmp = 0 if (i <= -7.8e-15) or not (i <= 8.8e-51): tmp = (y * i) + ((math.log(c) * -0.5) + t_1) else: tmp = t_1 + (math.log(c) * (b - 0.5)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(z + t)) tmp = 0.0 if ((i <= -7.8e-15) || !(i <= 8.8e-51)) tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * -0.5) + t_1)); else tmp = Float64(t_1 + Float64(log(c) * Float64(b - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (z + t); tmp = 0.0; if ((i <= -7.8e-15) || ~((i <= 8.8e-51))) tmp = (y * i) + ((log(c) * -0.5) + t_1); else tmp = t_1 + (log(c) * (b - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[i, -7.8e-15], N[Not[LessEqual[i, 8.8e-51]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \left(z + t\right)\\
\mathbf{if}\;i \leq -7.8 \cdot 10^{-15} \lor \neg \left(i \leq 8.8 \cdot 10^{-51}\right):\\
\;\;\;\;y \cdot i + \left(\log c \cdot -0.5 + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \log c \cdot \left(b - 0.5\right)\\
\end{array}
\end{array}
if i < -7.80000000000000053e-15 or 8.8000000000000001e-51 < i Initial program 99.9%
Taylor expanded in x around 0 87.5%
Taylor expanded in b around 0 80.4%
if -7.80000000000000053e-15 < i < 8.8000000000000001e-51Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.8%
+-commutative99.8%
associate-+l+99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in c around inf 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
*-commutative99.9%
log-rec99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
distribute-neg-in99.9%
Simplified99.9%
Taylor expanded in y around 0 97.4%
fma-def97.4%
Simplified97.4%
Taylor expanded in x around 0 79.4%
Final simplification79.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= z -2.4e+100)
(+ z (* y i))
(if (or (<= z -11.5) (and (not (<= z -7.5e-78)) (<= z -7.2e-171)))
(+ a (* (log c) (- b 0.5)))
(+ 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 <= -2.4e+100) {
tmp = z + (y * i);
} else if ((z <= -11.5) || (!(z <= -7.5e-78) && (z <= -7.2e-171))) {
tmp = a + (log(c) * (b - 0.5));
} 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 <= (-2.4d+100)) then
tmp = z + (y * i)
else if ((z <= (-11.5d0)) .or. (.not. (z <= (-7.5d-78))) .and. (z <= (-7.2d-171))) then
tmp = a + (log(c) * (b - 0.5d0))
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 <= -2.4e+100) {
tmp = z + (y * i);
} else if ((z <= -11.5) || (!(z <= -7.5e-78) && (z <= -7.2e-171))) {
tmp = a + (Math.log(c) * (b - 0.5));
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.4e+100: tmp = z + (y * i) elif (z <= -11.5) or (not (z <= -7.5e-78) and (z <= -7.2e-171)): tmp = a + (math.log(c) * (b - 0.5)) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.4e+100) tmp = Float64(z + Float64(y * i)); elseif ((z <= -11.5) || (!(z <= -7.5e-78) && (z <= -7.2e-171))) tmp = Float64(a + Float64(log(c) * Float64(b - 0.5))); 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 <= -2.4e+100) tmp = z + (y * i); elseif ((z <= -11.5) || (~((z <= -7.5e-78)) && (z <= -7.2e-171))) tmp = a + (log(c) * (b - 0.5)); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.4e+100], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -11.5], And[N[Not[LessEqual[z, -7.5e-78]], $MachinePrecision], LessEqual[z, -7.2e-171]]], N[(a + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+100}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{elif}\;z \leq -11.5 \lor \neg \left(z \leq -7.5 \cdot 10^{-78}\right) \land z \leq -7.2 \cdot 10^{-171}:\\
\;\;\;\;a + \log c \cdot \left(b - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -2.40000000000000012e100Initial program 99.9%
Taylor expanded in z around inf 64.6%
if -2.40000000000000012e100 < z < -11.5 or -7.50000000000000041e-78 < z < -7.20000000000000006e-171Initial program 99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
associate-+l+99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in c around inf 99.8%
+-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
fma-def99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.8%
+-commutative99.8%
*-commutative99.8%
log-rec99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
distribute-neg-in99.8%
Simplified99.8%
Taylor expanded in a around inf 37.1%
if -11.5 < z < -7.50000000000000041e-78 or -7.20000000000000006e-171 < z Initial program 99.9%
Taylor expanded in a around inf 38.8%
Final simplification43.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -2.45e+72) (not (<= i 1.4e+54))) (+ a (* y i)) (+ (+ a (+ z t)) (* (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 ((i <= -2.45e+72) || !(i <= 1.4e+54)) {
tmp = a + (y * i);
} else {
tmp = (a + (z + t)) + (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 ((i <= (-2.45d+72)) .or. (.not. (i <= 1.4d+54))) then
tmp = a + (y * i)
else
tmp = (a + (z + t)) + (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 ((i <= -2.45e+72) || !(i <= 1.4e+54)) {
tmp = a + (y * i);
} else {
tmp = (a + (z + t)) + (Math.log(c) * (b - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (i <= -2.45e+72) or not (i <= 1.4e+54): tmp = a + (y * i) else: tmp = (a + (z + t)) + (math.log(c) * (b - 0.5)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -2.45e+72) || !(i <= 1.4e+54)) tmp = Float64(a + Float64(y * i)); else tmp = Float64(Float64(a + Float64(z + t)) + 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 ((i <= -2.45e+72) || ~((i <= 1.4e+54))) tmp = a + (y * i); else tmp = (a + (z + t)) + (log(c) * (b - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -2.45e+72], N[Not[LessEqual[i, 1.4e+54]], $MachinePrecision]], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.45 \cdot 10^{+72} \lor \neg \left(i \leq 1.4 \cdot 10^{+54}\right):\\
\;\;\;\;a + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\\
\end{array}
\end{array}
if i < -2.45000000000000003e72 or 1.40000000000000008e54 < i Initial program 99.9%
Taylor expanded in a around inf 60.0%
if -2.45000000000000003e72 < i < 1.40000000000000008e54Initial program 99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.9%
+-commutative99.9%
fma-def99.8%
+-commutative99.8%
associate-+l+99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in c around inf 99.8%
+-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
fma-def99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.8%
+-commutative99.8%
*-commutative99.8%
log-rec99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
distribute-neg-in99.8%
Simplified99.8%
Taylor expanded in y around 0 93.1%
fma-def93.1%
Simplified93.1%
Taylor expanded in x around 0 76.9%
Final simplification70.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (+ z t))))
(if (<= y 4e-42)
(+ t_1 (* (log c) (- b 0.5)))
(+ (* y i) (+ (* (log c) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (z + t);
double tmp;
if (y <= 4e-42) {
tmp = t_1 + (log(c) * (b - 0.5));
} else {
tmp = (y * i) + ((log(c) * b) + 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 = a + (z + t)
if (y <= 4d-42) then
tmp = t_1 + (log(c) * (b - 0.5d0))
else
tmp = (y * i) + ((log(c) * b) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (z + t);
double tmp;
if (y <= 4e-42) {
tmp = t_1 + (Math.log(c) * (b - 0.5));
} else {
tmp = (y * i) + ((Math.log(c) * b) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (z + t) tmp = 0 if y <= 4e-42: tmp = t_1 + (math.log(c) * (b - 0.5)) else: tmp = (y * i) + ((math.log(c) * b) + t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(z + t)) tmp = 0.0 if (y <= 4e-42) tmp = Float64(t_1 + Float64(log(c) * Float64(b - 0.5))); else tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * b) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (z + t); tmp = 0.0; if (y <= 4e-42) tmp = t_1 + (log(c) * (b - 0.5)); else tmp = (y * i) + ((log(c) * b) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4e-42], N[(t$95$1 + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \left(z + t\right)\\
\mathbf{if}\;y \leq 4 \cdot 10^{-42}:\\
\;\;\;\;t_1 + \log c \cdot \left(b - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot b + t_1\right)\\
\end{array}
\end{array}
if y < 4.00000000000000015e-42Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in c around inf 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
*-commutative99.9%
log-rec99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
distribute-neg-in99.9%
Simplified99.9%
Taylor expanded in y around 0 99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around 0 80.3%
if 4.00000000000000015e-42 < y Initial program 99.9%
Taylor expanded in x around 0 88.1%
Taylor expanded in b around inf 86.0%
Final simplification83.6%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ a (+ z t)) (* (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 + (z + t)) + (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 + (z + t)) + (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 + (z + t)) + (Math.log(c) * (b - 0.5)));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + ((a + (z + t)) + (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(z + t)) + Float64(log(c) * Float64(b - 0.5)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + ((a + (z + t)) + (log(c) * (b - 0.5))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(z + t), $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(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 84.9%
Final simplification84.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= z -2.7e+100)
(+ z (* y i))
(if (or (<= z -1.8e+15) (and (not (<= z -7.2e-78)) (<= z -8e-171)))
(+ a (* (log c) b))
(+ 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 <= -2.7e+100) {
tmp = z + (y * i);
} else if ((z <= -1.8e+15) || (!(z <= -7.2e-78) && (z <= -8e-171))) {
tmp = a + (log(c) * b);
} 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 <= (-2.7d+100)) then
tmp = z + (y * i)
else if ((z <= (-1.8d+15)) .or. (.not. (z <= (-7.2d-78))) .and. (z <= (-8d-171))) then
tmp = a + (log(c) * b)
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 <= -2.7e+100) {
tmp = z + (y * i);
} else if ((z <= -1.8e+15) || (!(z <= -7.2e-78) && (z <= -8e-171))) {
tmp = a + (Math.log(c) * b);
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.7e+100: tmp = z + (y * i) elif (z <= -1.8e+15) or (not (z <= -7.2e-78) and (z <= -8e-171)): tmp = a + (math.log(c) * b) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.7e+100) tmp = Float64(z + Float64(y * i)); elseif ((z <= -1.8e+15) || (!(z <= -7.2e-78) && (z <= -8e-171))) tmp = Float64(a + Float64(log(c) * b)); 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 <= -2.7e+100) tmp = z + (y * i); elseif ((z <= -1.8e+15) || (~((z <= -7.2e-78)) && (z <= -8e-171))) tmp = a + (log(c) * b); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.7e+100], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.8e+15], And[N[Not[LessEqual[z, -7.2e-78]], $MachinePrecision], LessEqual[z, -8e-171]]], N[(a + N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+100}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{+15} \lor \neg \left(z \leq -7.2 \cdot 10^{-78}\right) \land z \leq -8 \cdot 10^{-171}:\\
\;\;\;\;a + \log c \cdot b\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -2.69999999999999998e100Initial program 99.9%
Taylor expanded in z around inf 64.6%
if -2.69999999999999998e100 < z < -1.8e15 or -7.2000000000000005e-78 < z < -7.9999999999999999e-171Initial program 99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
associate-+l+99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in c around inf 99.8%
+-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
fma-def99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.8%
+-commutative99.8%
*-commutative99.8%
log-rec99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
distribute-neg-in99.8%
Simplified99.8%
Taylor expanded in a around inf 37.8%
Taylor expanded in b around inf 37.7%
mul-1-neg37.7%
distribute-rgt-neg-out37.7%
Simplified37.7%
if -1.8e15 < z < -7.2000000000000005e-78 or -7.9999999999999999e-171 < z Initial program 99.9%
Taylor expanded in a around inf 38.6%
Final simplification43.2%
(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 84.9%
add-sqr-sqrt39.9%
pow239.9%
sub-neg39.9%
metadata-eval39.9%
Applied egg-rr39.9%
Taylor expanded in t around 0 70.1%
Final simplification70.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -5.6e+136) (+ 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 <= -5.6e+136) {
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 <= (-5.6d+136)) 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 <= -5.6e+136) {
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 <= -5.6e+136: 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 <= -5.6e+136) 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 <= -5.6e+136) 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, -5.6e+136], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+136}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -5.6000000000000004e136Initial program 99.9%
Taylor expanded in z around inf 66.6%
if -5.6000000000000004e136 < z Initial program 99.9%
Taylor expanded in a around inf 40.5%
Final simplification44.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 2.3e+146) (* 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 <= 2.3e+146) {
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 <= 2.3d+146) 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 <= 2.3e+146) {
tmp = y * i;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= 2.3e+146: tmp = y * i else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 2.3e+146) 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 <= 2.3e+146) tmp = y * i; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 2.3e+146], N[(y * i), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.3 \cdot 10^{+146}:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < 2.3e146Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around inf 26.2%
*-commutative26.2%
Simplified26.2%
if 2.3e146 < a Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
fma-def100.0%
+-commutative100.0%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in c around inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
*-commutative99.9%
log-rec99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
distribute-neg-in99.9%
Simplified99.9%
Taylor expanded in a around inf 59.9%
Taylor expanded in a around inf 44.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 a around inf 40.0%
Final simplification40.0%
(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%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in c around inf 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
*-commutative99.9%
log-rec99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
distribute-neg-in99.9%
Simplified99.9%
Taylor expanded in a around inf 31.4%
Taylor expanded in a around inf 16.9%
Final simplification16.9%
herbie shell --seed 2023279
(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)))