
(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 y i (fma (- b 0.5) (log c) (+ (fma x (log y) (+ z t)) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(y, i, fma((b - 0.5), log(c), (fma(x, log(y), (z + t)) + a)));
}
function code(x, y, z, t, a, b, c, i) return fma(y, i, fma(Float64(b - 0.5), log(c), Float64(fma(x, log(y), Float64(z + t)) + a))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(x, \log y, z + t\right) + a\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ a (+ t (+ z (* x (log y))))) (* (- 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 ((a + (t + (z + (x * log(y))))) + ((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 = ((a + (t + (z + (x * log(y))))) + ((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 ((a + (t + (z + (x * Math.log(y))))) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return ((a + (t + (z + (x * math.log(y))))) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((a + (t + (z + (x * log(y))))) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ a (+ t (+ z (* x (log y))))) (* b (log c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * Math.log(y))))) + (b * Math.log(c)));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + ((a + (t + (z + (x * math.log(y))))) + (b * math.log(c)))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(b * log(c)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + b \cdot \log c\right)
\end{array}
Initial program 99.9%
Taylor expanded in b around inf 98.8%
*-commutative98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (+ a (+ (+ z t) (fma y i (* (log c) (+ b -0.5))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + ((z + t) + fma(y, i, (log(c) * (b + -0.5))));
}
function code(x, y, z, t, a, b, c, i) return Float64(a + Float64(Float64(z + t) + fma(y, i, Float64(log(c) * Float64(b + -0.5))))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + N[(N[(z + t), $MachinePrecision] + N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + \left(\left(z + t\right) + \mathsf{fma}\left(y, i, \log c \cdot \left(b + -0.5\right)\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 87.5%
associate-+r+87.5%
+-commutative87.5%
*-commutative87.5%
sub-neg87.5%
metadata-eval87.5%
+-commutative87.5%
distribute-rgt-out87.5%
+-commutative87.5%
distribute-rgt-out87.5%
*-commutative87.5%
fma-def87.6%
*-commutative87.6%
+-commutative87.6%
Simplified87.6%
Final simplification87.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= i -0.0155)
(+ (* y i) (+ (+ z t) a))
(if (<= i 1.4e-41)
(+ (+ z a) (* (log c) (+ b -0.5)))
(+ (* y i) (+ a (+ z (* (log c) -0.5)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (i <= -0.0155) {
tmp = (y * i) + ((z + t) + a);
} else if (i <= 1.4e-41) {
tmp = (z + a) + (log(c) * (b + -0.5));
} else {
tmp = (y * i) + (a + (z + (log(c) * -0.5)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (i <= (-0.0155d0)) then
tmp = (y * i) + ((z + t) + a)
else if (i <= 1.4d-41) then
tmp = (z + a) + (log(c) * (b + (-0.5d0)))
else
tmp = (y * i) + (a + (z + (log(c) * (-0.5d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (i <= -0.0155) {
tmp = (y * i) + ((z + t) + a);
} else if (i <= 1.4e-41) {
tmp = (z + a) + (Math.log(c) * (b + -0.5));
} else {
tmp = (y * i) + (a + (z + (Math.log(c) * -0.5)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if i <= -0.0155: tmp = (y * i) + ((z + t) + a) elif i <= 1.4e-41: tmp = (z + a) + (math.log(c) * (b + -0.5)) else: tmp = (y * i) + (a + (z + (math.log(c) * -0.5))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (i <= -0.0155) tmp = Float64(Float64(y * i) + Float64(Float64(z + t) + a)); elseif (i <= 1.4e-41) tmp = Float64(Float64(z + a) + Float64(log(c) * Float64(b + -0.5))); else tmp = Float64(Float64(y * i) + Float64(a + Float64(z + Float64(log(c) * -0.5)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (i <= -0.0155) tmp = (y * i) + ((z + t) + a); elseif (i <= 1.4e-41) tmp = (z + a) + (log(c) * (b + -0.5)); else tmp = (y * i) + (a + (z + (log(c) * -0.5))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, -0.0155], N[(N[(y * i), $MachinePrecision] + N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.4e-41], N[(N[(z + a), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -0.0155:\\
\;\;\;\;y \cdot i + \left(\left(z + t\right) + a\right)\\
\mathbf{elif}\;i \leq 1.4 \cdot 10^{-41}:\\
\;\;\;\;\left(z + a\right) + \log c \cdot \left(b + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + \left(z + \log c \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if i < -0.0155Initial program 99.9%
Taylor expanded in x around 0 88.6%
add-cube-cbrt88.5%
pow388.5%
sub-neg88.5%
metadata-eval88.5%
Applied egg-rr88.5%
Taylor expanded in b around inf 80.8%
if -0.0155 < i < 1.4000000000000001e-41Initial program 99.9%
Taylor expanded in x around 0 82.2%
add-log-exp44.3%
*-commutative44.3%
exp-to-pow44.3%
sub-neg44.3%
metadata-eval44.3%
Applied egg-rr44.3%
Taylor expanded in t around 0 68.2%
associate-+r+68.2%
sub-neg68.2%
metadata-eval68.2%
+-commutative68.2%
Simplified68.2%
Taylor expanded in y around 0 67.3%
associate-+r+67.3%
+-commutative67.3%
sub-neg67.3%
metadata-eval67.3%
Simplified67.3%
if 1.4000000000000001e-41 < i Initial program 99.8%
Taylor expanded in x around 0 94.6%
Taylor expanded in b around 0 82.1%
Taylor expanded in t around 0 68.4%
+-commutative68.4%
Simplified68.4%
Final simplification70.9%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (* (- b 0.5) (log c)) (+ (+ z t) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (((b - 0.5) * log(c)) + ((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) + (((b - 0.5d0) * log(c)) + ((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) + (((b - 0.5) * Math.log(c)) + ((z + t) + a));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + (((b - 0.5) * math.log(c)) + ((z + t) + a))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(Float64(b - 0.5) * log(c)) + Float64(Float64(z + t) + a))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + (((b - 0.5) * log(c)) + ((z + t) + a)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(\left(b - 0.5\right) \cdot \log c + \left(\left(z + t\right) + a\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 87.5%
Final simplification87.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -5.6e-7) (not (<= i 1.05e-41))) (+ (* y i) (+ (+ z t) a)) (+ (+ 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) {
double tmp;
if ((i <= -5.6e-7) || !(i <= 1.05e-41)) {
tmp = (y * i) + ((z + t) + a);
} else {
tmp = (z + a) + (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 <= (-5.6d-7)) .or. (.not. (i <= 1.05d-41))) then
tmp = (y * i) + ((z + t) + a)
else
tmp = (z + a) + (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 <= -5.6e-7) || !(i <= 1.05e-41)) {
tmp = (y * i) + ((z + t) + a);
} else {
tmp = (z + a) + (Math.log(c) * (b + -0.5));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (i <= -5.6e-7) or not (i <= 1.05e-41): tmp = (y * i) + ((z + t) + a) else: tmp = (z + a) + (math.log(c) * (b + -0.5)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -5.6e-7) || !(i <= 1.05e-41)) tmp = Float64(Float64(y * i) + Float64(Float64(z + t) + a)); else tmp = Float64(Float64(z + a) + 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 <= -5.6e-7) || ~((i <= 1.05e-41))) tmp = (y * i) + ((z + t) + a); else tmp = (z + a) + (log(c) * (b + -0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -5.6e-7], N[Not[LessEqual[i, 1.05e-41]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -5.6 \cdot 10^{-7} \lor \neg \left(i \leq 1.05 \cdot 10^{-41}\right):\\
\;\;\;\;y \cdot i + \left(\left(z + t\right) + a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) + \log c \cdot \left(b + -0.5\right)\\
\end{array}
\end{array}
if i < -5.60000000000000038e-7 or 1.05000000000000006e-41 < i Initial program 99.9%
Taylor expanded in x around 0 91.9%
add-cube-cbrt91.8%
pow391.8%
sub-neg91.8%
metadata-eval91.8%
Applied egg-rr91.8%
Taylor expanded in b around inf 81.5%
if -5.60000000000000038e-7 < i < 1.05000000000000006e-41Initial program 99.9%
Taylor expanded in x around 0 82.2%
add-log-exp44.3%
*-commutative44.3%
exp-to-pow44.3%
sub-neg44.3%
metadata-eval44.3%
Applied egg-rr44.3%
Taylor expanded in t around 0 68.2%
associate-+r+68.2%
sub-neg68.2%
metadata-eval68.2%
+-commutative68.2%
Simplified68.2%
Taylor expanded in y around 0 67.3%
associate-+r+67.3%
+-commutative67.3%
sub-neg67.3%
metadata-eval67.3%
Simplified67.3%
Final simplification75.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 3.6e+119) (+ (* y i) (+ z (* (- b 0.5) (log c)))) (+ (* y i) (+ (+ z t) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 3.6e+119) {
tmp = (y * i) + (z + ((b - 0.5) * log(c)));
} else {
tmp = (y * i) + ((z + t) + a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (a <= 3.6d+119) then
tmp = (y * i) + (z + ((b - 0.5d0) * log(c)))
else
tmp = (y * i) + ((z + t) + a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 3.6e+119) {
tmp = (y * i) + (z + ((b - 0.5) * Math.log(c)));
} else {
tmp = (y * i) + ((z + t) + a);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= 3.6e+119: tmp = (y * i) + (z + ((b - 0.5) * math.log(c))) else: tmp = (y * i) + ((z + t) + a) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 3.6e+119) tmp = Float64(Float64(y * i) + Float64(z + Float64(Float64(b - 0.5) * log(c)))); else tmp = Float64(Float64(y * i) + Float64(Float64(z + t) + a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= 3.6e+119) tmp = (y * i) + (z + ((b - 0.5) * log(c))); else tmp = (y * i) + ((z + t) + a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 3.6e+119], N[(N[(y * i), $MachinePrecision] + N[(z + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.6 \cdot 10^{+119}:\\
\;\;\;\;y \cdot i + \left(z + \left(b - 0.5\right) \cdot \log c\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(z + t\right) + a\right)\\
\end{array}
\end{array}
if a < 3.60000000000000001e119Initial program 99.8%
Taylor expanded in x around 0 86.5%
add-log-exp47.3%
*-commutative47.3%
exp-to-pow47.3%
sub-neg47.3%
metadata-eval47.3%
Applied egg-rr47.3%
Taylor expanded in t around 0 71.2%
associate-+r+71.2%
sub-neg71.2%
metadata-eval71.2%
+-commutative71.2%
Simplified71.2%
Taylor expanded in a around 0 63.3%
if 3.60000000000000001e119 < a Initial program 100.0%
Taylor expanded in x around 0 91.9%
add-cube-cbrt91.9%
pow391.9%
sub-neg91.9%
metadata-eval91.9%
Applied egg-rr91.9%
Taylor expanded in b around inf 88.9%
Final simplification68.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 87.5%
add-log-exp49.0%
*-commutative49.0%
exp-to-pow49.0%
sub-neg49.0%
metadata-eval49.0%
Applied egg-rr49.0%
Taylor expanded in t around 0 75.1%
associate-+r+75.1%
sub-neg75.1%
metadata-eval75.1%
+-commutative75.1%
Simplified75.1%
Final simplification75.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= b -2.8e+174) (not (<= b 1e+213))) (+ (* y i) (* b (log c))) (+ (* y i) (+ (+ z t) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -2.8e+174) || !(b <= 1e+213)) {
tmp = (y * i) + (b * log(c));
} else {
tmp = (y * i) + ((z + t) + a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((b <= (-2.8d+174)) .or. (.not. (b <= 1d+213))) then
tmp = (y * i) + (b * log(c))
else
tmp = (y * i) + ((z + t) + a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -2.8e+174) || !(b <= 1e+213)) {
tmp = (y * i) + (b * Math.log(c));
} else {
tmp = (y * i) + ((z + t) + a);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (b <= -2.8e+174) or not (b <= 1e+213): tmp = (y * i) + (b * math.log(c)) else: tmp = (y * i) + ((z + t) + a) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -2.8e+174) || !(b <= 1e+213)) tmp = Float64(Float64(y * i) + Float64(b * log(c))); else tmp = Float64(Float64(y * i) + Float64(Float64(z + t) + a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((b <= -2.8e+174) || ~((b <= 1e+213))) tmp = (y * i) + (b * log(c)); else tmp = (y * i) + ((z + t) + a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -2.8e+174], N[Not[LessEqual[b, 1e+213]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.8 \cdot 10^{+174} \lor \neg \left(b \leq 10^{+213}\right):\\
\;\;\;\;y \cdot i + b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(z + t\right) + a\right)\\
\end{array}
\end{array}
if b < -2.7999999999999999e174 or 9.99999999999999984e212 < b Initial program 99.7%
Taylor expanded in x around 0 89.8%
Taylor expanded in b around inf 73.7%
*-commutative73.7%
Simplified73.7%
if -2.7999999999999999e174 < b < 9.99999999999999984e212Initial program 99.9%
Taylor expanded in x around 0 87.0%
add-cube-cbrt86.9%
pow386.9%
sub-neg86.9%
metadata-eval86.9%
Applied egg-rr86.9%
Taylor expanded in b around inf 80.4%
Final simplification79.0%
(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(Float64(z + 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[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(\left(z + t\right) + a\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 87.5%
add-cube-cbrt87.3%
pow387.3%
sub-neg87.3%
metadata-eval87.3%
Applied egg-rr87.3%
Taylor expanded in b around inf 70.8%
Final simplification70.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -5.4e+175) 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 <= -5.4e+175) {
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 <= (-5.4d+175)) 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 <= -5.4e+175) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -5.4e+175: tmp = z else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -5.4e+175) 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 <= -5.4e+175) tmp = z; else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -5.4e+175], z, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+175}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -5.4000000000000002e175Initial program 99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in b around 0 95.7%
Taylor expanded in z around inf 77.5%
Taylor expanded in z around inf 62.6%
if -5.4000000000000002e175 < z Initial program 99.9%
Taylor expanded in a around inf 44.0%
Final simplification45.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -7e+103) (+ 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+103) {
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+103)) 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+103) {
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+103: 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+103) 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+103) 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+103], 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^{+103}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -7e103Initial program 99.9%
Taylor expanded in x around 0 97.2%
Taylor expanded in b around 0 89.8%
Taylor expanded in z around inf 63.9%
if -7e103 < z Initial program 99.9%
Taylor expanded in a around inf 43.5%
Final simplification46.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 1.9e+71) a (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 1.9e+71) {
tmp = a;
} else {
tmp = 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 (y <= 1.9d+71) then
tmp = a
else
tmp = 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 (y <= 1.9e+71) {
tmp = a;
} else {
tmp = y * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 1.9e+71: tmp = a else: tmp = y * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 1.9e+71) tmp = a; else tmp = Float64(y * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= 1.9e+71) tmp = a; else tmp = y * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 1.9e+71], a, N[(y * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.9 \cdot 10^{+71}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\end{array}
\end{array}
if y < 1.9e71Initial program 99.9%
Taylor expanded in x around 0 84.0%
add-log-exp41.3%
*-commutative41.3%
exp-to-pow41.3%
sub-neg41.3%
metadata-eval41.3%
Applied egg-rr41.3%
Taylor expanded in t around 0 68.5%
associate-+r+68.5%
sub-neg68.5%
metadata-eval68.5%
+-commutative68.5%
Simplified68.5%
Taylor expanded in a around inf 23.4%
if 1.9e71 < y Initial program 99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 54.4%
*-commutative54.4%
Simplified54.4%
Final simplification34.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2.65e+79) 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.65e+79) {
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.65d+79)) 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.65e+79) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.65e+79: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.65e+79) 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.65e+79) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.65e+79], z, a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{+79}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -2.64999999999999989e79Initial program 99.9%
Taylor expanded in x around 0 93.5%
Taylor expanded in b around 0 87.4%
Taylor expanded in z around inf 57.4%
Taylor expanded in z around inf 42.3%
if -2.64999999999999989e79 < z Initial program 99.9%
Taylor expanded in x around 0 86.3%
add-log-exp48.6%
*-commutative48.6%
exp-to-pow48.6%
sub-neg48.6%
metadata-eval48.6%
Applied egg-rr48.6%
Taylor expanded in t around 0 73.6%
associate-+r+73.6%
sub-neg73.6%
metadata-eval73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in a around inf 18.8%
Final simplification22.9%
(FPCore (x y z t a b c i) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
def code(x, y, z, t, a, b, c, i): return a
function code(x, y, z, t, a, b, c, i) return a end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 87.5%
add-log-exp49.0%
*-commutative49.0%
exp-to-pow49.0%
sub-neg49.0%
metadata-eval49.0%
Applied egg-rr49.0%
Taylor expanded in t around 0 75.1%
associate-+r+75.1%
sub-neg75.1%
metadata-eval75.1%
+-commutative75.1%
Simplified75.1%
Taylor expanded in a around inf 19.2%
Final simplification19.2%
herbie shell --seed 2023293
(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)))