
(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 17 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 x (log y) (+ z t)) (fma (+ b -0.5) (log c) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(y, i, (fma(x, log(y), (z + t)) + fma((b + -0.5), log(c), a)));
}
function code(x, y, z, t, a, b, c, i) return fma(y, i, Float64(fma(x, log(y), Float64(z + t)) + fma(Float64(b + -0.5), log(c), a))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(x * N[Log[y], $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(x, \log y, z + t\right) + \mathsf{fma}\left(b + -0.5, \log c, a\right)\right)
\end{array}
Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5)))
(* y i))))
(if (<= t_1 -1e+302)
(* y i)
(if (<= t_1 -100.0)
(fma t (/ z t) t)
(if (<= t_1 1.5e+306) (fma t (/ a t) t) (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i);
double tmp;
if (t_1 <= -1e+302) {
tmp = y * i;
} else if (t_1 <= -100.0) {
tmp = fma(t, (z / t), t);
} else if (t_1 <= 1.5e+306) {
tmp = fma(t, (a / t), t);
} else {
tmp = y * i;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5))) + Float64(y * i)) tmp = 0.0 if (t_1 <= -1e+302) tmp = Float64(y * i); elseif (t_1 <= -100.0) tmp = fma(t, Float64(z / t), t); elseif (t_1 <= 1.5e+306) tmp = fma(t, Float64(a / t), t); else tmp = Float64(y * i); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+302], N[(y * i), $MachinePrecision], If[LessEqual[t$95$1, -100.0], N[(t * N[(z / t), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[t$95$1, 1.5e+306], N[(t * N[(a / t), $MachinePrecision] + t), $MachinePrecision], N[(y * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+302}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;t\_1 \leq -100:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{z}{t}, t\right)\\
\mathbf{elif}\;t\_1 \leq 1.5 \cdot 10^{+306}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{a}{t}, t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.0000000000000001e302 or 1.5000000000000001e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 100.0%
Taylor expanded in y around inf
lower-*.f6471.4
Applied rewrites71.4%
if -1.0000000000000001e302 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -100Initial program 99.9%
Taylor expanded in t around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
Applied rewrites74.6%
Taylor expanded in z around inf
Applied rewrites32.7%
if -100 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1.5000000000000001e306Initial program 99.9%
Taylor expanded in t around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
Applied rewrites67.9%
Taylor expanded in a around inf
Applied rewrites23.2%
Final simplification36.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5)))
(* y i))))
(if (<= t_1 -2e+294)
(* y i)
(if (<= t_1 -100.0)
(* i (/ z i))
(if (<= t_1 1.5e+306) (fma t (/ a t) t) (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i);
double tmp;
if (t_1 <= -2e+294) {
tmp = y * i;
} else if (t_1 <= -100.0) {
tmp = i * (z / i);
} else if (t_1 <= 1.5e+306) {
tmp = fma(t, (a / t), t);
} else {
tmp = y * i;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5))) + Float64(y * i)) tmp = 0.0 if (t_1 <= -2e+294) tmp = Float64(y * i); elseif (t_1 <= -100.0) tmp = Float64(i * Float64(z / i)); elseif (t_1 <= 1.5e+306) tmp = fma(t, Float64(a / t), t); else tmp = Float64(y * i); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+294], N[(y * i), $MachinePrecision], If[LessEqual[t$95$1, -100.0], N[(i * N[(z / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.5e+306], N[(t * N[(a / t), $MachinePrecision] + t), $MachinePrecision], N[(y * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+294}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;t\_1 \leq -100:\\
\;\;\;\;i \cdot \frac{z}{i}\\
\mathbf{elif}\;t\_1 \leq 1.5 \cdot 10^{+306}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{a}{t}, t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -2.00000000000000013e294 or 1.5000000000000001e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 100.0%
Taylor expanded in y around inf
lower-*.f6465.2
Applied rewrites65.2%
if -2.00000000000000013e294 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -100Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites67.3%
Taylor expanded in z around inf
Applied rewrites13.1%
if -100 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1.5000000000000001e306Initial program 99.9%
Taylor expanded in t around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
Applied rewrites67.9%
Taylor expanded in a around inf
Applied rewrites23.2%
Final simplification28.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5)))
(* y i))))
(if (<= t_1 -2e+294)
(* y i)
(if (<= t_1 -100.0)
(* i (/ z i))
(if (<= t_1 5e+282) (* i (/ a i)) (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i);
double tmp;
if (t_1 <= -2e+294) {
tmp = y * i;
} else if (t_1 <= -100.0) {
tmp = i * (z / i);
} else if (t_1 <= 5e+282) {
tmp = i * (a / i);
} 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) :: t_1
real(8) :: tmp
t_1 = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5d0))) + (y * i)
if (t_1 <= (-2d+294)) then
tmp = y * i
else if (t_1 <= (-100.0d0)) then
tmp = i * (z / i)
else if (t_1 <= 5d+282) then
tmp = i * (a / i)
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 t_1 = ((a + (t + (z + (x * Math.log(y))))) + (Math.log(c) * (b - 0.5))) + (y * i);
double tmp;
if (t_1 <= -2e+294) {
tmp = y * i;
} else if (t_1 <= -100.0) {
tmp = i * (z / i);
} else if (t_1 <= 5e+282) {
tmp = i * (a / i);
} else {
tmp = y * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a + (t + (z + (x * math.log(y))))) + (math.log(c) * (b - 0.5))) + (y * i) tmp = 0 if t_1 <= -2e+294: tmp = y * i elif t_1 <= -100.0: tmp = i * (z / i) elif t_1 <= 5e+282: tmp = i * (a / i) else: tmp = y * i return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5))) + Float64(y * i)) tmp = 0.0 if (t_1 <= -2e+294) tmp = Float64(y * i); elseif (t_1 <= -100.0) tmp = Float64(i * Float64(z / i)); elseif (t_1 <= 5e+282) tmp = Float64(i * Float64(a / i)); else tmp = Float64(y * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i); tmp = 0.0; if (t_1 <= -2e+294) tmp = y * i; elseif (t_1 <= -100.0) tmp = i * (z / i); elseif (t_1 <= 5e+282) tmp = i * (a / i); else tmp = y * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+294], N[(y * i), $MachinePrecision], If[LessEqual[t$95$1, -100.0], N[(i * N[(z / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+282], N[(i * N[(a / i), $MachinePrecision]), $MachinePrecision], N[(y * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+294}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;t\_1 \leq -100:\\
\;\;\;\;i \cdot \frac{z}{i}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+282}:\\
\;\;\;\;i \cdot \frac{a}{i}\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -2.00000000000000013e294 or 4.99999999999999978e282 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6453.3
Applied rewrites53.3%
if -2.00000000000000013e294 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -100Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites67.3%
Taylor expanded in z around inf
Applied rewrites13.1%
if -100 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 4.99999999999999978e282Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites75.7%
Taylor expanded in a around inf
Applied rewrites12.0%
Final simplification24.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5)))
(* y i))))
(if (<= t_1 -1e+302)
(* y i)
(if (<= t_1 -2e+67) (fma t (/ z t) t) (* i (+ y (/ a i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i);
double tmp;
if (t_1 <= -1e+302) {
tmp = y * i;
} else if (t_1 <= -2e+67) {
tmp = fma(t, (z / t), t);
} else {
tmp = i * (y + (a / i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5))) + Float64(y * i)) tmp = 0.0 if (t_1 <= -1e+302) tmp = Float64(y * i); elseif (t_1 <= -2e+67) tmp = fma(t, Float64(z / t), t); else tmp = Float64(i * Float64(y + Float64(a / i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+302], N[(y * i), $MachinePrecision], If[LessEqual[t$95$1, -2e+67], N[(t * N[(z / t), $MachinePrecision] + t), $MachinePrecision], N[(i * N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+302}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+67}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{z}{t}, t\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot \left(y + \frac{a}{i}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.0000000000000001e302Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6458.7
Applied rewrites58.7%
if -1.0000000000000001e302 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.99999999999999997e67Initial program 99.9%
Taylor expanded in t around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
Applied rewrites74.3%
Taylor expanded in z around inf
Applied rewrites33.3%
if -1.99999999999999997e67 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites78.1%
Taylor expanded in a around inf
Applied rewrites35.9%
Final simplification37.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* b (log c))))
(if (<=
(+ (+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5))) (* y i))
-100.0)
(fma y i (+ (+ z t) t_1))
(fma y i (+ a t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = b * log(c);
double tmp;
if ((((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i)) <= -100.0) {
tmp = fma(y, i, ((z + t) + t_1));
} else {
tmp = fma(y, i, (a + t_1));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(b * log(c)) tmp = 0.0 if (Float64(Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5))) + Float64(y * i)) <= -100.0) tmp = fma(y, i, Float64(Float64(z + t) + t_1)); else tmp = fma(y, i, Float64(a + t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -100.0], N[(y * i + N[(N[(z + t), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \log c\\
\mathbf{if}\;\left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i \leq -100:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(z + t\right) + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + t\_1\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -100Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
sub-negN/A
associate-/l*N/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6492.8
Applied rewrites92.8%
Taylor expanded in x around 0
lower-+.f6478.2
Applied rewrites78.2%
Taylor expanded in b around inf
Applied rewrites68.1%
if -100 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6484.2
Applied rewrites84.2%
Taylor expanded in b around inf
Applied rewrites52.7%
Final simplification60.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5))) (* y i))
-100.0)
(* i (+ y (/ z i)))
(* i (+ y (/ a i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i)) <= -100.0) {
tmp = i * (y + (z / i));
} else {
tmp = i * (y + (a / 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 ((((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5d0))) + (y * i)) <= (-100.0d0)) then
tmp = i * (y + (z / i))
else
tmp = i * (y + (a / 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 ((((a + (t + (z + (x * Math.log(y))))) + (Math.log(c) * (b - 0.5))) + (y * i)) <= -100.0) {
tmp = i * (y + (z / i));
} else {
tmp = i * (y + (a / i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (((a + (t + (z + (x * math.log(y))))) + (math.log(c) * (b - 0.5))) + (y * i)) <= -100.0: tmp = i * (y + (z / i)) else: tmp = i * (y + (a / i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5))) + Float64(y * i)) <= -100.0) tmp = Float64(i * Float64(y + Float64(z / i))); else tmp = Float64(i * Float64(y + Float64(a / i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i)) <= -100.0) tmp = i * (y + (z / i)); else tmp = i * (y + (a / i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -100.0], N[(i * N[(y + N[(z / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i \leq -100:\\
\;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot \left(y + \frac{a}{i}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -100Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites69.4%
Taylor expanded in z around inf
Applied rewrites30.5%
if -100 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites77.2%
Taylor expanded in a around inf
Applied rewrites35.5%
Final simplification33.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y i (+ a (fma (log c) (+ b -0.5) z)))))
(if (<= (- b 0.5) -5e+150)
t_1
(if (<= (- b 0.5) 2e+172)
(fma y i (+ (fma x (log y) (+ z t)) (* (- a) -1.0)))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(y, i, (a + fma(log(c), (b + -0.5), z)));
double tmp;
if ((b - 0.5) <= -5e+150) {
tmp = t_1;
} else if ((b - 0.5) <= 2e+172) {
tmp = fma(y, i, (fma(x, log(y), (z + t)) + (-a * -1.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, i, Float64(a + fma(log(c), Float64(b + -0.5), z))) tmp = 0.0 if (Float64(b - 0.5) <= -5e+150) tmp = t_1; elseif (Float64(b - 0.5) <= 2e+172) tmp = fma(y, i, Float64(fma(x, log(y), Float64(z + t)) + Float64(Float64(-a) * -1.0))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * i + N[(a + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b - 0.5), $MachinePrecision], -5e+150], t$95$1, If[LessEqual[N[(b - 0.5), $MachinePrecision], 2e+172], N[(y * i + N[(N[(x * N[Log[y], $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision] + N[((-a) * -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, a + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\\
\mathbf{if}\;b - 0.5 \leq -5 \cdot 10^{+150}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b - 0.5 \leq 2 \cdot 10^{+172}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(x, \log y, z + t\right) + \left(-a\right) \cdot -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 b #s(literal 1/2 binary64)) < -5.00000000000000009e150 or 2.0000000000000002e172 < (-.f64 b #s(literal 1/2 binary64)) Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6498.2
Applied rewrites98.2%
Taylor expanded in t around 0
Applied rewrites92.5%
if -5.00000000000000009e150 < (-.f64 b #s(literal 1/2 binary64)) < 2.0000000000000002e172Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
sub-negN/A
associate-/l*N/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6497.0
Applied rewrites97.0%
Taylor expanded in a around inf
Applied rewrites96.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y i (* x (log y)))))
(if (<= x -1.25e+207)
t_1
(if (<= x 1.25e+253)
(fma y i (+ a (+ t (fma (log c) (+ b -0.5) z))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(y, i, (x * log(y)));
double tmp;
if (x <= -1.25e+207) {
tmp = t_1;
} else if (x <= 1.25e+253) {
tmp = fma(y, i, (a + (t + fma(log(c), (b + -0.5), z))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, i, Float64(x * log(y))) tmp = 0.0 if (x <= -1.25e+207) tmp = t_1; elseif (x <= 1.25e+253) tmp = fma(y, i, Float64(a + Float64(t + fma(log(c), Float64(b + -0.5), z)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e+207], t$95$1, If[LessEqual[x, 1.25e+253], N[(y * i + N[(a + N[(t + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, x \cdot \log y\right)\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+207}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+253}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + \left(t + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.25e207 or 1.2499999999999999e253 < x Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6487.6
Applied rewrites87.6%
if -1.25e207 < x < 1.2499999999999999e253Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6494.6
Applied rewrites94.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y i (* x (log y)))))
(if (<= x -1.25e+207)
t_1
(if (<= x 1.25e+253)
(+ a (+ (fma i y z) (fma (log c) (+ b -0.5) t)))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(y, i, (x * log(y)));
double tmp;
if (x <= -1.25e+207) {
tmp = t_1;
} else if (x <= 1.25e+253) {
tmp = a + (fma(i, y, z) + fma(log(c), (b + -0.5), t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, i, Float64(x * log(y))) tmp = 0.0 if (x <= -1.25e+207) tmp = t_1; elseif (x <= 1.25e+253) tmp = Float64(a + Float64(fma(i, y, z) + fma(log(c), Float64(b + -0.5), t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e+207], t$95$1, If[LessEqual[x, 1.25e+253], N[(a + N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, x \cdot \log y\right)\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+207}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+253}:\\
\;\;\;\;a + \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b + -0.5, t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.25e207 or 1.2499999999999999e253 < x Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6487.6
Applied rewrites87.6%
if -1.25e207 < x < 1.2499999999999999e253Initial program 99.9%
Taylor expanded in x around 0
lower-+.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6494.6
Applied rewrites94.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y i (* x (log y)))))
(if (<= x -1.25e+207)
t_1
(if (<= x 1.25e+253) (fma y i (+ a (fma (log c) (+ b -0.5) z))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(y, i, (x * log(y)));
double tmp;
if (x <= -1.25e+207) {
tmp = t_1;
} else if (x <= 1.25e+253) {
tmp = fma(y, i, (a + fma(log(c), (b + -0.5), z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, i, Float64(x * log(y))) tmp = 0.0 if (x <= -1.25e+207) tmp = t_1; elseif (x <= 1.25e+253) tmp = fma(y, i, Float64(a + fma(log(c), Float64(b + -0.5), z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e+207], t$95$1, If[LessEqual[x, 1.25e+253], N[(y * i + N[(a + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, x \cdot \log y\right)\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+207}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+253}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.25e207 or 1.2499999999999999e253 < x Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6487.6
Applied rewrites87.6%
if -1.25e207 < x < 1.2499999999999999e253Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6494.6
Applied rewrites94.6%
Taylor expanded in t around 0
Applied rewrites77.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y i (* x (log y)))))
(if (<= x -1.3e+205)
t_1
(if (<= x 3.1e+248) (fma y i (+ (* (- a) -1.0) (+ z t))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(y, i, (x * log(y)));
double tmp;
if (x <= -1.3e+205) {
tmp = t_1;
} else if (x <= 3.1e+248) {
tmp = fma(y, i, ((-a * -1.0) + (z + t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, i, Float64(x * log(y))) tmp = 0.0 if (x <= -1.3e+205) tmp = t_1; elseif (x <= 3.1e+248) tmp = fma(y, i, Float64(Float64(Float64(-a) * -1.0) + Float64(z + t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.3e+205], t$95$1, If[LessEqual[x, 3.1e+248], N[(y * i + N[(N[((-a) * -1.0), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, x \cdot \log y\right)\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{+205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+248}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(-a\right) \cdot -1 + \left(z + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.2999999999999999e205 or 3.10000000000000005e248 < x Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6485.9
Applied rewrites85.9%
if -1.2999999999999999e205 < x < 3.10000000000000005e248Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
sub-negN/A
associate-/l*N/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6490.1
Applied rewrites90.1%
Taylor expanded in x around 0
lower-+.f6485.1
Applied rewrites85.1%
Taylor expanded in a around inf
Applied rewrites77.0%
Final simplification78.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -6.4e+109) (fma y i (+ (* (- a) -1.0) (+ z t))) (fma y i (+ a (* b (log c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -6.4e+109) {
tmp = fma(y, i, ((-a * -1.0) + (z + t)));
} else {
tmp = fma(y, i, (a + (b * log(c))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -6.4e+109) tmp = fma(y, i, Float64(Float64(Float64(-a) * -1.0) + Float64(z + t))); else tmp = fma(y, i, Float64(a + Float64(b * log(c)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -6.4e+109], N[(y * i + N[(N[((-a) * -1.0), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(-a\right) \cdot -1 + \left(z + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + b \cdot \log c\right)\\
\end{array}
\end{array}
if z < -6.4000000000000002e109Initial program 100.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
sub-negN/A
associate-/l*N/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6494.7
Applied rewrites94.7%
Taylor expanded in x around 0
lower-+.f6489.8
Applied rewrites89.8%
Taylor expanded in a around inf
Applied rewrites83.4%
if -6.4000000000000002e109 < z Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6483.0
Applied rewrites83.0%
Taylor expanded in b around inf
Applied rewrites54.7%
Final simplification58.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -1.25e+207)
t_1
(if (<= x 2.2e+253) (fma y i (+ (* (- a) -1.0) (+ z t))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.25e+207) {
tmp = t_1;
} else if (x <= 2.2e+253) {
tmp = fma(y, i, ((-a * -1.0) + (z + t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1.25e+207) tmp = t_1; elseif (x <= 2.2e+253) tmp = fma(y, i, Float64(Float64(Float64(-a) * -1.0) + Float64(z + t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e+207], t$95$1, If[LessEqual[x, 2.2e+253], N[(y * i + N[(N[((-a) * -1.0), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+207}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+253}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(-a\right) \cdot -1 + \left(z + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.25e207 or 2.20000000000000006e253 < x Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
if -1.25e207 < x < 2.20000000000000006e253Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
sub-negN/A
associate-/l*N/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6489.8
Applied rewrites89.8%
Taylor expanded in x around 0
lower-+.f6484.9
Applied rewrites84.9%
Taylor expanded in a around inf
Applied rewrites76.4%
Final simplification76.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 540000.0) (* i (/ a i)) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 540000.0) {
tmp = i * (a / i);
} 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 <= 540000.0d0) then
tmp = i * (a / i)
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 <= 540000.0) {
tmp = i * (a / i);
} else {
tmp = y * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 540000.0: tmp = i * (a / i) else: tmp = y * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 540000.0) tmp = Float64(i * Float64(a / i)); 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 <= 540000.0) tmp = i * (a / i); else tmp = y * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 540000.0], N[(i * N[(a / i), $MachinePrecision]), $MachinePrecision], N[(y * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 540000:\\
\;\;\;\;i \cdot \frac{a}{i}\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\end{array}
\end{array}
if y < 5.4e5Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites68.4%
Taylor expanded in a around inf
Applied rewrites13.3%
if 5.4e5 < y Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6444.8
Applied rewrites44.8%
Final simplification29.3%
(FPCore (x y z t a b c i) :precision binary64 (fma y i (+ (* (- a) -1.0) (+ z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(y, i, ((-a * -1.0) + (z + t)));
}
function code(x, y, z, t, a, b, c, i) return fma(y, i, Float64(Float64(Float64(-a) * -1.0) + Float64(z + t))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[((-a) * -1.0), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, i, \left(-a\right) \cdot -1 + \left(z + t\right)\right)
\end{array}
Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lower-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
sub-negN/A
associate-/l*N/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6490.8
Applied rewrites90.8%
Taylor expanded in x around 0
lower-+.f6476.4
Applied rewrites76.4%
Taylor expanded in a around inf
Applied rewrites68.6%
Final simplification68.6%
(FPCore (x y z t a b c i) :precision binary64 (* y i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 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 = 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 y * i;
}
def code(x, y, z, t, a, b, c, i): return y * i
function code(x, y, z, t, a, b, c, i) return Float64(y * i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = y * i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i
\end{array}
Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6424.3
Applied rewrites24.3%
Final simplification24.3%
herbie shell --seed 2024233
(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)))