
(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 18 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) (+ z (fma x (log y) (+ 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), (z + fma(x, log(y), (t + a)))));
}
function code(x, y, z, t, a, b, c, i) return fma(y, i, fma(Float64(b + -0.5), log(c), Float64(z + fma(x, log(y), 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[(z + N[(x * N[Log[y], $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)
\end{array}
Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ z (fma x (log y) (+ t a))) (+ (* y i) (* (+ b -0.5) (log c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (z + fma(x, log(y), (t + a))) + ((y * i) + ((b + -0.5) * log(c)));
}
function code(x, y, z, t, a, b, c, i) return Float64(Float64(z + fma(x, log(y), Float64(t + a))) + Float64(Float64(y * i) + Float64(Float64(b + -0.5) * log(c)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(z + N[(x * N[Log[y], $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y * i), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(z + \mathsf{fma}\left(x, \log y, t + a\right)\right) + \left(y \cdot i + \left(b + -0.5\right) \cdot \log c\right)
\end{array}
Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * Math.log(y))))) + (Math.log(c) * (b - 0.5)));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + ((a + (t + (z + (x * math.log(y))))) + (math.log(c) * (b - 0.5)))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -2.05e+102)
(+ (* y i) (+ z (fma x (log y) a)))
(if (<= x 9e+137)
(+ a (+ (+ z t) (fma y i (* (+ b -0.5) (log c)))))
(+ (* y i) (+ z (+ a (* x (log y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -2.05e+102) {
tmp = (y * i) + (z + fma(x, log(y), a));
} else if (x <= 9e+137) {
tmp = a + ((z + t) + fma(y, i, ((b + -0.5) * log(c))));
} else {
tmp = (y * i) + (z + (a + (x * log(y))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -2.05e+102) tmp = Float64(Float64(y * i) + Float64(z + fma(x, log(y), a))); elseif (x <= 9e+137) tmp = Float64(a + Float64(Float64(z + t) + fma(y, i, Float64(Float64(b + -0.5) * log(c))))); else tmp = Float64(Float64(y * i) + Float64(z + Float64(a + Float64(x * log(y))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2.05e+102], N[(N[(y * i), $MachinePrecision] + N[(z + N[(x * N[Log[y], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e+137], N[(a + N[(N[(z + t), $MachinePrecision] + N[(y * i + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(z + N[(a + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{+102}:\\
\;\;\;\;y \cdot i + \left(z + \mathsf{fma}\left(x, \log y, a\right)\right)\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+137}:\\
\;\;\;\;a + \left(\left(z + t\right) + \mathsf{fma}\left(y, i, \left(b + -0.5\right) \cdot \log c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(z + \left(a + x \cdot \log y\right)\right)\\
\end{array}
\end{array}
if x < -2.05e102Initial program 99.7%
associate-+l+99.7%
associate-+l+99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
+-commutative99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.8%
fma-udef99.8%
fma-udef99.8%
metadata-eval99.8%
sub-neg99.8%
associate-+r+99.8%
sub-neg99.8%
metadata-eval99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 89.9%
Taylor expanded in t around 0 76.4%
log-pow14.7%
+-commutative14.7%
log-pow76.4%
fma-def76.5%
Simplified76.5%
if -2.05e102 < x < 9.0000000000000003e137Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 98.4%
associate-+r+98.4%
*-commutative98.4%
sub-neg98.4%
metadata-eval98.4%
fma-def98.4%
+-commutative98.4%
Simplified98.4%
if 9.0000000000000003e137 < x Initial program 99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
fma-udef99.8%
fma-udef99.8%
metadata-eval99.8%
sub-neg99.8%
associate-+r+99.8%
sub-neg99.8%
metadata-eval99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 92.4%
Taylor expanded in t around 0 79.5%
Final simplification90.6%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ a (+ z (+ (* x (log y)) (* (log c) (- b 0.5)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (a + (z + ((x * log(y)) + (log(c) * (b - 0.5)))));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (y * i) + (a + (z + ((x * log(y)) + (log(c) * (b - 0.5d0)))))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (a + (z + ((x * Math.log(y)) + (Math.log(c) * (b - 0.5)))));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + (a + (z + ((x * math.log(y)) + (math.log(c) * (b - 0.5)))))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(a + Float64(z + Float64(Float64(x * log(y)) + Float64(log(c) * Float64(b - 0.5)))))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + (a + (z + ((x * log(y)) + (log(c) * (b - 0.5))))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(a + \left(z + \left(x \cdot \log y + \log c \cdot \left(b - 0.5\right)\right)\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in t around 0 80.8%
Final simplification80.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -7.8e+104)
(+ (* y i) (+ z (fma x (log y) a)))
(if (<= x 3.6e+140)
(+ (* y i) (+ a (+ t (+ z (* (log c) (- b 0.5))))))
(+ (* y i) (+ z (+ a (* x (log y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -7.8e+104) {
tmp = (y * i) + (z + fma(x, log(y), a));
} else if (x <= 3.6e+140) {
tmp = (y * i) + (a + (t + (z + (log(c) * (b - 0.5)))));
} else {
tmp = (y * i) + (z + (a + (x * log(y))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -7.8e+104) tmp = Float64(Float64(y * i) + Float64(z + fma(x, log(y), a))); elseif (x <= 3.6e+140) tmp = Float64(Float64(y * i) + Float64(a + Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5)))))); else tmp = Float64(Float64(y * i) + Float64(z + Float64(a + Float64(x * log(y))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -7.8e+104], N[(N[(y * i), $MachinePrecision] + N[(z + N[(x * N[Log[y], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.6e+140], N[(N[(y * i), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(z + N[(a + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{+104}:\\
\;\;\;\;y \cdot i + \left(z + \mathsf{fma}\left(x, \log y, a\right)\right)\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+140}:\\
\;\;\;\;y \cdot i + \left(a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(z + \left(a + x \cdot \log y\right)\right)\\
\end{array}
\end{array}
if x < -7.80000000000000033e104Initial program 99.7%
associate-+l+99.7%
associate-+l+99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
+-commutative99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.8%
fma-udef99.8%
fma-udef99.8%
metadata-eval99.8%
sub-neg99.8%
associate-+r+99.8%
sub-neg99.8%
metadata-eval99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 89.9%
Taylor expanded in t around 0 76.4%
log-pow14.7%
+-commutative14.7%
log-pow76.4%
fma-def76.5%
Simplified76.5%
if -7.80000000000000033e104 < x < 3.6e140Initial program 99.9%
Taylor expanded in x around 0 98.4%
if 3.6e140 < x Initial program 99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
fma-udef99.8%
fma-udef99.8%
metadata-eval99.8%
sub-neg99.8%
associate-+r+99.8%
sub-neg99.8%
metadata-eval99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 92.4%
Taylor expanded in t around 0 79.5%
Final simplification90.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -4.5e+103) (not (<= x 2.2e+140))) (+ (* y i) (+ z (+ a (* x (log y))))) (+ (* y i) (+ a (+ t (+ z (* (log c) (- b 0.5))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -4.5e+103) || !(x <= 2.2e+140)) {
tmp = (y * i) + (z + (a + (x * log(y))));
} else {
tmp = (y * i) + (a + (t + (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 <= (-4.5d+103)) .or. (.not. (x <= 2.2d+140))) then
tmp = (y * i) + (z + (a + (x * log(y))))
else
tmp = (y * i) + (a + (t + (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 <= -4.5e+103) || !(x <= 2.2e+140)) {
tmp = (y * i) + (z + (a + (x * Math.log(y))));
} else {
tmp = (y * i) + (a + (t + (z + (Math.log(c) * (b - 0.5)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -4.5e+103) or not (x <= 2.2e+140): tmp = (y * i) + (z + (a + (x * math.log(y)))) else: tmp = (y * i) + (a + (t + (z + (math.log(c) * (b - 0.5))))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -4.5e+103) || !(x <= 2.2e+140)) tmp = Float64(Float64(y * i) + Float64(z + Float64(a + Float64(x * log(y))))); else tmp = Float64(Float64(y * i) + Float64(a + Float64(t + 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 <= -4.5e+103) || ~((x <= 2.2e+140))) tmp = (y * i) + (z + (a + (x * log(y)))); else tmp = (y * i) + (a + (t + (z + (log(c) * (b - 0.5))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -4.5e+103], N[Not[LessEqual[x, 2.2e+140]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(z + N[(a + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+103} \lor \neg \left(x \leq 2.2 \cdot 10^{+140}\right):\\
\;\;\;\;y \cdot i + \left(z + \left(a + x \cdot \log y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\
\end{array}
\end{array}
if x < -4.50000000000000001e103 or 2.1999999999999998e140 < x Initial program 99.7%
associate-+l+99.7%
associate-+l+99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
+-commutative99.7%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
fma-udef99.8%
fma-udef99.8%
metadata-eval99.8%
sub-neg99.8%
associate-+r+99.8%
sub-neg99.8%
metadata-eval99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 91.1%
Taylor expanded in t around 0 78.0%
if -4.50000000000000001e103 < x < 2.1999999999999998e140Initial program 99.9%
Taylor expanded in x around 0 98.4%
Final simplification90.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (- b 0.5) -2e+274)
(+ a (+ t (+ z (* (log c) (- b 0.5)))))
(if (<= (- b 0.5) 4e+246)
(+ (* y i) (+ z (+ a (* x (log y)))))
(* 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 - 0.5) <= -2e+274) {
tmp = a + (t + (z + (log(c) * (b - 0.5))));
} else if ((b - 0.5) <= 4e+246) {
tmp = (y * i) + (z + (a + (x * log(y))));
} else {
tmp = 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 ((b - 0.5d0) <= (-2d+274)) then
tmp = a + (t + (z + (log(c) * (b - 0.5d0))))
else if ((b - 0.5d0) <= 4d+246) then
tmp = (y * i) + (z + (a + (x * log(y))))
else
tmp = 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 ((b - 0.5) <= -2e+274) {
tmp = a + (t + (z + (Math.log(c) * (b - 0.5))));
} else if ((b - 0.5) <= 4e+246) {
tmp = (y * i) + (z + (a + (x * Math.log(y))));
} else {
tmp = b * Math.log(c);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (b - 0.5) <= -2e+274: tmp = a + (t + (z + (math.log(c) * (b - 0.5)))) elif (b - 0.5) <= 4e+246: tmp = (y * i) + (z + (a + (x * math.log(y)))) else: tmp = b * math.log(c) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(b - 0.5) <= -2e+274) tmp = Float64(a + Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5))))); elseif (Float64(b - 0.5) <= 4e+246) tmp = Float64(Float64(y * i) + Float64(z + Float64(a + Float64(x * log(y))))); else tmp = Float64(b * log(c)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((b - 0.5) <= -2e+274) tmp = a + (t + (z + (log(c) * (b - 0.5)))); elseif ((b - 0.5) <= 4e+246) tmp = (y * i) + (z + (a + (x * log(y)))); else tmp = b * log(c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(b - 0.5), $MachinePrecision], -2e+274], N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b - 0.5), $MachinePrecision], 4e+246], N[(N[(y * i), $MachinePrecision] + N[(z + N[(a + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -2 \cdot 10^{+274}:\\
\;\;\;\;a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{elif}\;b - 0.5 \leq 4 \cdot 10^{+246}:\\
\;\;\;\;y \cdot i + \left(z + \left(a + x \cdot \log y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \log c\\
\end{array}
\end{array}
if (-.f64 b 1/2) < -1.99999999999999984e274Initial program 99.7%
Taylor expanded in x around 0 95.6%
Taylor expanded in y around 0 95.6%
if -1.99999999999999984e274 < (-.f64 b 1/2) < 4.00000000000000027e246Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 91.0%
Taylor expanded in t around 0 70.5%
if 4.00000000000000027e246 < (-.f64 b 1/2) Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-+r+100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 91.8%
associate-+r+91.8%
sub-neg91.8%
metadata-eval91.8%
Simplified91.8%
Taylor expanded in b around inf 82.7%
*-commutative82.7%
Simplified82.7%
Final simplification72.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (- b 0.5) -2e+274)
(+ a (+ t (+ z (* (log c) (- b 0.5)))))
(if (<= (- b 0.5) 7e+208)
(+ (* y i) (+ z (+ a (* x (log y)))))
(+ (* 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 ((b - 0.5) <= -2e+274) {
tmp = a + (t + (z + (log(c) * (b - 0.5))));
} else if ((b - 0.5) <= 7e+208) {
tmp = (y * i) + (z + (a + (x * log(y))));
} else {
tmp = (y * i) + ((t + 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 ((b - 0.5d0) <= (-2d+274)) then
tmp = a + (t + (z + (log(c) * (b - 0.5d0))))
else if ((b - 0.5d0) <= 7d+208) then
tmp = (y * i) + (z + (a + (x * log(y))))
else
tmp = (y * i) + ((t + 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 ((b - 0.5) <= -2e+274) {
tmp = a + (t + (z + (Math.log(c) * (b - 0.5))));
} else if ((b - 0.5) <= 7e+208) {
tmp = (y * i) + (z + (a + (x * Math.log(y))));
} else {
tmp = (y * i) + ((t + a) + (b * Math.log(c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (b - 0.5) <= -2e+274: tmp = a + (t + (z + (math.log(c) * (b - 0.5)))) elif (b - 0.5) <= 7e+208: tmp = (y * i) + (z + (a + (x * math.log(y)))) else: tmp = (y * i) + ((t + a) + (b * math.log(c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(b - 0.5) <= -2e+274) tmp = Float64(a + Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5))))); elseif (Float64(b - 0.5) <= 7e+208) tmp = Float64(Float64(y * i) + Float64(z + Float64(a + Float64(x * log(y))))); else tmp = Float64(Float64(y * i) + Float64(Float64(t + 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 ((b - 0.5) <= -2e+274) tmp = a + (t + (z + (log(c) * (b - 0.5)))); elseif ((b - 0.5) <= 7e+208) tmp = (y * i) + (z + (a + (x * log(y)))); else tmp = (y * i) + ((t + a) + (b * log(c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(b - 0.5), $MachinePrecision], -2e+274], N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b - 0.5), $MachinePrecision], 7e+208], N[(N[(y * i), $MachinePrecision] + N[(z + N[(a + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(t + a), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -2 \cdot 10^{+274}:\\
\;\;\;\;a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{elif}\;b - 0.5 \leq 7 \cdot 10^{+208}:\\
\;\;\;\;y \cdot i + \left(z + \left(a + x \cdot \log y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(t + a\right) + b \cdot \log c\right)\\
\end{array}
\end{array}
if (-.f64 b 1/2) < -1.99999999999999984e274Initial program 99.7%
Taylor expanded in x around 0 95.6%
Taylor expanded in y around 0 95.6%
if -1.99999999999999984e274 < (-.f64 b 1/2) < 7.00000000000000033e208Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 93.0%
Taylor expanded in t around 0 71.2%
if 7.00000000000000033e208 < (-.f64 b 1/2) Initial program 99.9%
Taylor expanded in z around 0 95.9%
associate-+r+95.9%
fma-def95.9%
sub-neg95.9%
metadata-eval95.9%
+-commutative95.9%
Simplified95.9%
Taylor expanded in x around 0 83.7%
associate-+r+83.7%
sub-neg83.7%
metadata-eval83.7%
Simplified83.7%
Taylor expanded in b around inf 83.7%
*-commutative83.7%
Simplified83.7%
Final simplification73.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* y i) (+ z (+ t a)))) (t_2 (+ (* y i) (* x (log y)))))
(if (<= x -8.5e+193)
t_2
(if (<= x -2.15e+127)
t_1
(if (<= x -4e-49)
(+ a (+ t (+ z (* (log c) (- b 0.5)))))
(if (<= x 1.1e+160) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + (z + (t + a));
double t_2 = (y * i) + (x * log(y));
double tmp;
if (x <= -8.5e+193) {
tmp = t_2;
} else if (x <= -2.15e+127) {
tmp = t_1;
} else if (x <= -4e-49) {
tmp = a + (t + (z + (log(c) * (b - 0.5))));
} else if (x <= 1.1e+160) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (y * i) + (z + (t + a))
t_2 = (y * i) + (x * log(y))
if (x <= (-8.5d+193)) then
tmp = t_2
else if (x <= (-2.15d+127)) then
tmp = t_1
else if (x <= (-4d-49)) then
tmp = a + (t + (z + (log(c) * (b - 0.5d0))))
else if (x <= 1.1d+160) then
tmp = t_1
else
tmp = t_2
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 = (y * i) + (z + (t + a));
double t_2 = (y * i) + (x * Math.log(y));
double tmp;
if (x <= -8.5e+193) {
tmp = t_2;
} else if (x <= -2.15e+127) {
tmp = t_1;
} else if (x <= -4e-49) {
tmp = a + (t + (z + (Math.log(c) * (b - 0.5))));
} else if (x <= 1.1e+160) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (y * i) + (z + (t + a)) t_2 = (y * i) + (x * math.log(y)) tmp = 0 if x <= -8.5e+193: tmp = t_2 elif x <= -2.15e+127: tmp = t_1 elif x <= -4e-49: tmp = a + (t + (z + (math.log(c) * (b - 0.5)))) elif x <= 1.1e+160: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + Float64(z + Float64(t + a))) t_2 = Float64(Float64(y * i) + Float64(x * log(y))) tmp = 0.0 if (x <= -8.5e+193) tmp = t_2; elseif (x <= -2.15e+127) tmp = t_1; elseif (x <= -4e-49) tmp = Float64(a + Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5))))); elseif (x <= 1.1e+160) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (y * i) + (z + (t + a)); t_2 = (y * i) + (x * log(y)); tmp = 0.0; if (x <= -8.5e+193) tmp = t_2; elseif (x <= -2.15e+127) tmp = t_1; elseif (x <= -4e-49) tmp = a + (t + (z + (log(c) * (b - 0.5)))); elseif (x <= 1.1e+160) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+193], t$95$2, If[LessEqual[x, -2.15e+127], t$95$1, If[LessEqual[x, -4e-49], N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.1e+160], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot i + \left(z + \left(t + a\right)\right)\\
t_2 := y \cdot i + x \cdot \log y\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+193}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.15 \cdot 10^{+127}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-49}:\\
\;\;\;\;a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+160}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -8.5000000000000003e193 or 1.09999999999999996e160 < x Initial program 99.7%
Taylor expanded in x around inf 72.4%
if -8.5000000000000003e193 < x < -2.14999999999999992e127 or -3.99999999999999975e-49 < x < 1.09999999999999996e160Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 84.9%
Taylor expanded in x around 0 80.6%
associate-+r+80.6%
Simplified80.6%
if -2.14999999999999992e127 < x < -3.99999999999999975e-49Initial program 99.8%
Taylor expanded in x around 0 93.5%
Taylor expanded in y around 0 83.0%
Final simplification78.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.2e+192) (not (<= x 9e+159))) (+ (* y i) (* x (log y))) (+ (* y i) (+ z (+ t a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.2e+192) || !(x <= 9e+159)) {
tmp = (y * i) + (x * log(y));
} else {
tmp = (y * i) + (z + (t + a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-1.2d+192)) .or. (.not. (x <= 9d+159))) then
tmp = (y * i) + (x * log(y))
else
tmp = (y * i) + (z + (t + a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.2e+192) || !(x <= 9e+159)) {
tmp = (y * i) + (x * Math.log(y));
} else {
tmp = (y * i) + (z + (t + a));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.2e+192) or not (x <= 9e+159): tmp = (y * i) + (x * math.log(y)) else: tmp = (y * i) + (z + (t + a)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.2e+192) || !(x <= 9e+159)) tmp = Float64(Float64(y * i) + Float64(x * log(y))); else tmp = Float64(Float64(y * i) + Float64(z + Float64(t + a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -1.2e+192) || ~((x <= 9e+159))) tmp = (y * i) + (x * log(y)); else tmp = (y * i) + (z + (t + a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.2e+192], N[Not[LessEqual[x, 9e+159]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+192} \lor \neg \left(x \leq 9 \cdot 10^{+159}\right):\\
\;\;\;\;y \cdot i + x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(z + \left(t + a\right)\right)\\
\end{array}
\end{array}
if x < -1.1999999999999999e192 or 9.00000000000000053e159 < x Initial program 99.7%
Taylor expanded in x around inf 72.4%
if -1.1999999999999999e192 < x < 9.00000000000000053e159Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 83.2%
Taylor expanded in x around 0 78.5%
associate-+r+78.5%
Simplified78.5%
Final simplification76.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.6e+195) (not (<= x 6.2e+235))) (* x (log y)) (+ (* y i) (+ z (+ t a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.6e+195) || !(x <= 6.2e+235)) {
tmp = x * log(y);
} else {
tmp = (y * i) + (z + (t + a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-1.6d+195)) .or. (.not. (x <= 6.2d+235))) then
tmp = x * log(y)
else
tmp = (y * i) + (z + (t + a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.6e+195) || !(x <= 6.2e+235)) {
tmp = x * Math.log(y);
} else {
tmp = (y * i) + (z + (t + a));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.6e+195) or not (x <= 6.2e+235): tmp = x * math.log(y) else: tmp = (y * i) + (z + (t + a)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.6e+195) || !(x <= 6.2e+235)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(y * i) + Float64(z + Float64(t + a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -1.6e+195) || ~((x <= 6.2e+235))) tmp = x * log(y); else tmp = (y * i) + (z + (t + a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.6e+195], N[Not[LessEqual[x, 6.2e+235]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+195} \lor \neg \left(x \leq 6.2 \cdot 10^{+235}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(z + \left(t + a\right)\right)\\
\end{array}
\end{array}
if x < -1.59999999999999991e195 or 6.20000000000000022e235 < x Initial program 99.6%
associate-+l+99.6%
associate-+l+99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.7%
fma-udef99.7%
fma-udef99.7%
metadata-eval99.7%
sub-neg99.7%
associate-+r+99.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 68.8%
if -1.59999999999999991e195 < x < 6.20000000000000022e235Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 83.3%
Taylor expanded in x around 0 75.9%
associate-+r+75.9%
Simplified75.9%
Final simplification74.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2.7e+194) z (if (<= z -4.1e+178) (* y i) (if (<= z -2.7e+119) z (+ a (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.7e+194) {
tmp = z;
} else if (z <= -4.1e+178) {
tmp = y * i;
} else if (z <= -2.7e+119) {
tmp = z;
} 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+194)) then
tmp = z
else if (z <= (-4.1d+178)) then
tmp = y * i
else if (z <= (-2.7d+119)) then
tmp = z
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+194) {
tmp = z;
} else if (z <= -4.1e+178) {
tmp = y * i;
} else if (z <= -2.7e+119) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.7e+194: tmp = z elif z <= -4.1e+178: tmp = y * i elif z <= -2.7e+119: tmp = z else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.7e+194) tmp = z; elseif (z <= -4.1e+178) tmp = Float64(y * i); elseif (z <= -2.7e+119) tmp = z; 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+194) tmp = z; elseif (z <= -4.1e+178) tmp = y * i; elseif (z <= -2.7e+119) tmp = z; else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.7e+194], z, If[LessEqual[z, -4.1e+178], N[(y * i), $MachinePrecision], If[LessEqual[z, -2.7e+119], z, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+194}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{+178}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{+119}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -2.7000000000000002e194 or -4.09999999999999996e178 < z < -2.6999999999999998e119Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 63.1%
if -2.7000000000000002e194 < z < -4.09999999999999996e178Initial program 99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 45.5%
*-commutative45.5%
Simplified45.5%
if -2.6999999999999998e119 < z Initial program 99.8%
Taylor expanded in a around inf 37.3%
Final simplification40.6%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ z (+ t a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (z + (t + a));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (y * i) + (z + (t + a))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (z + (t + a));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + (z + (t + a))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(z + Float64(t + a))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + (z + (t + a)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(z + \left(t + a\right)\right)
\end{array}
Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 84.5%
Taylor expanded in x around 0 65.4%
associate-+r+65.4%
Simplified65.4%
Final simplification65.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2.75e+194) z (if (<= z -3.9e+178) (* y i) (if (<= z -5.6e+117) z a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.75e+194) {
tmp = z;
} else if (z <= -3.9e+178) {
tmp = y * i;
} else if (z <= -5.6e+117) {
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 <= (-2.75d+194)) then
tmp = z
else if (z <= (-3.9d+178)) then
tmp = y * i
else if (z <= (-5.6d+117)) 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 <= -2.75e+194) {
tmp = z;
} else if (z <= -3.9e+178) {
tmp = y * i;
} else if (z <= -5.6e+117) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.75e+194: tmp = z elif z <= -3.9e+178: tmp = y * i elif z <= -5.6e+117: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.75e+194) tmp = z; elseif (z <= -3.9e+178) tmp = Float64(y * i); elseif (z <= -5.6e+117) 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 <= -2.75e+194) tmp = z; elseif (z <= -3.9e+178) tmp = y * i; elseif (z <= -5.6e+117) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.75e+194], z, If[LessEqual[z, -3.9e+178], N[(y * i), $MachinePrecision], If[LessEqual[z, -5.6e+117], z, a]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{+194}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{+178}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{+117}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -2.75e194 or -3.8999999999999997e178 < z < -5.59999999999999995e117Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 63.1%
if -2.75e194 < z < -3.8999999999999997e178Initial program 99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 45.5%
*-commutative45.5%
Simplified45.5%
if -5.59999999999999995e117 < z Initial program 99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 16.3%
Final simplification22.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -7e+116) (+ 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 <= -7e+116) {
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 <= (-7d+116)) 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 <= -7e+116) {
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 <= -7e+116: 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 <= -7e+116) 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 <= -7e+116) 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, -7e+116], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+116}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -6.99999999999999993e116Initial program 99.9%
Taylor expanded in z around inf 72.5%
if -6.99999999999999993e116 < z Initial program 99.8%
Taylor expanded in a around inf 37.3%
Final simplification42.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2.2e+119) z a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.2e+119) {
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 <= (-2.2d+119)) 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 <= -2.2e+119) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.2e+119: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.2e+119) 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 <= -2.2e+119) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.2e+119], z, a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+119}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -2.2000000000000001e119Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 52.0%
if -2.2000000000000001e119 < z Initial program 99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 16.3%
Final simplification21.5%
(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%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 14.3%
Final simplification14.3%
herbie shell --seed 2024010
(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)))