
(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 (+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
}
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 = (i * y) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))));
}
def code(x, y, z, t, a, b, c, i): return (i * y) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x)))))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x))))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right)
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z t_1)))))))
(if (<= t_2 -4e+293)
(* (+ (/ z i) y) i)
(if (<= t_2 -230.0)
(+ (fma (/ z t) t t) (* i y))
(if (<= t_2 8e+304) (+ (* (log c) b) (+ a t)) (+ t_1 (* i y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(y) * x;
double t_2 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + t_1))));
double tmp;
if (t_2 <= -4e+293) {
tmp = ((z / i) + y) * i;
} else if (t_2 <= -230.0) {
tmp = fma((z / t), t, t) + (i * y);
} else if (t_2 <= 8e+304) {
tmp = (log(c) * b) + (a + t);
} else {
tmp = t_1 + (i * y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + t_1))))) tmp = 0.0 if (t_2 <= -4e+293) tmp = Float64(Float64(Float64(z / i) + y) * i); elseif (t_2 <= -230.0) tmp = Float64(fma(Float64(z / t), t, t) + Float64(i * y)); elseif (t_2 <= 8e+304) tmp = Float64(Float64(log(c) * b) + Float64(a + t)); else tmp = Float64(t_1 + Float64(i * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+293], N[(N[(N[(z / i), $MachinePrecision] + y), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$2, -230.0], N[(N[(N[(z / t), $MachinePrecision] * t + t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 8e+304], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(i * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + t\_1\right)\right)\right)\right)\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+293}:\\
\;\;\;\;\left(\frac{z}{i} + y\right) \cdot i\\
\mathbf{elif}\;t\_2 \leq -230:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, t\right) + i \cdot y\\
\mathbf{elif}\;t\_2 \leq 8 \cdot 10^{+304}:\\
\;\;\;\;\log c \cdot b + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + i \cdot y\\
\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)) < -3.9999999999999997e293Initial program 99.9%
Taylor expanded in i around -inf
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites89.1%
Taylor expanded in z around inf
Applied rewrites77.1%
if -3.9999999999999997e293 < (+.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)) < -230Initial program 99.8%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites73.1%
Taylor expanded in z around inf
Applied rewrites38.3%
if -230 < (+.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)) < 7.9999999999999995e304Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6476.8
Applied rewrites76.8%
Taylor expanded in b around inf
Applied rewrites43.4%
if 7.9999999999999995e304 < (+.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.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6492.2
Applied rewrites92.2%
Final simplification47.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* i y)
(+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))))
(if (<= t_1 -4e+293)
(* (+ (/ z i) y) i)
(if (<= t_1 -230.0)
(+ (fma (/ z t) t t) (* i y))
(if (<= t_1 2e+299)
(+ (* (log c) b) (+ a t))
(fma (/ (* i y) a) a a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
double tmp;
if (t_1 <= -4e+293) {
tmp = ((z / i) + y) * i;
} else if (t_1 <= -230.0) {
tmp = fma((z / t), t, t) + (i * y);
} else if (t_1 <= 2e+299) {
tmp = (log(c) * b) + (a + t);
} else {
tmp = fma(((i * y) / a), a, a);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) tmp = 0.0 if (t_1 <= -4e+293) tmp = Float64(Float64(Float64(z / i) + y) * i); elseif (t_1 <= -230.0) tmp = Float64(fma(Float64(z / t), t, t) + Float64(i * y)); elseif (t_1 <= 2e+299) tmp = Float64(Float64(log(c) * b) + Float64(a + t)); else tmp = fma(Float64(Float64(i * y) / a), a, a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+293], N[(N[(N[(z / i), $MachinePrecision] + y), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, -230.0], N[(N[(N[(z / t), $MachinePrecision] * t + t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+299], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * y), $MachinePrecision] / a), $MachinePrecision] * a + a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+293}:\\
\;\;\;\;\left(\frac{z}{i} + y\right) \cdot i\\
\mathbf{elif}\;t\_1 \leq -230:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, t\right) + i \cdot y\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;\log c \cdot b + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{i \cdot y}{a}, a, a\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)) < -3.9999999999999997e293Initial program 99.9%
Taylor expanded in i around -inf
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites89.1%
Taylor expanded in z around inf
Applied rewrites77.1%
if -3.9999999999999997e293 < (+.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)) < -230Initial program 99.8%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites73.1%
Taylor expanded in z around inf
Applied rewrites38.3%
if -230 < (+.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.0000000000000001e299Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6476.0
Applied rewrites76.0%
Taylor expanded in b around inf
Applied rewrites42.1%
if 2.0000000000000001e299 < (+.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.8%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
Applied rewrites91.7%
Taylor expanded in y around inf
Applied rewrites66.9%
Final simplification46.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* i y)
(+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))))
(if (<= t_1 -4e+293)
(* (+ (/ z i) y) i)
(if (<= t_1 -10.0) (+ (fma (/ z t) t t) (* i y)) (+ (* i y) (+ a t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
double tmp;
if (t_1 <= -4e+293) {
tmp = ((z / i) + y) * i;
} else if (t_1 <= -10.0) {
tmp = fma((z / t), t, t) + (i * y);
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) tmp = 0.0 if (t_1 <= -4e+293) tmp = Float64(Float64(Float64(z / i) + y) * i); elseif (t_1 <= -10.0) tmp = Float64(fma(Float64(z / t), t, t) + Float64(i * y)); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+293], N[(N[(N[(z / i), $MachinePrecision] + y), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, -10.0], N[(N[(N[(z / t), $MachinePrecision] * t + t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+293}:\\
\;\;\;\;\left(\frac{z}{i} + y\right) \cdot i\\
\mathbf{elif}\;t\_1 \leq -10:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, t\right) + i \cdot y\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\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)) < -3.9999999999999997e293Initial program 99.9%
Taylor expanded in i around -inf
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites89.1%
Taylor expanded in z around inf
Applied rewrites77.1%
if -3.9999999999999997e293 < (+.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)) < -10Initial program 99.8%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites73.6%
Taylor expanded in z around inf
Applied rewrites37.6%
if -10 < (+.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.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6477.0
Applied rewrites77.0%
Taylor expanded in y around inf
Applied rewrites41.1%
Final simplification43.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* i y)
(+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))))
(if (<= t_1 -2e+305)
(* i y)
(if (<= t_1 -4e+90) (* (/ z i) i) (+ (* i y) (+ a t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
double tmp;
if (t_1 <= -2e+305) {
tmp = i * y;
} else if (t_1 <= -4e+90) {
tmp = (z / i) * i;
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (i * y) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))
if (t_1 <= (-2d+305)) then
tmp = i * y
else if (t_1 <= (-4d+90)) then
tmp = (z / i) * i
else
tmp = (i * y) + (a + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (i * y) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))));
double tmp;
if (t_1 <= -2e+305) {
tmp = i * y;
} else if (t_1 <= -4e+90) {
tmp = (z / i) * i;
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (i * y) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x))))) tmp = 0 if t_1 <= -2e+305: tmp = i * y elif t_1 <= -4e+90: tmp = (z / i) * i else: tmp = (i * y) + (a + t) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) tmp = 0.0 if (t_1 <= -2e+305) tmp = Float64(i * y); elseif (t_1 <= -4e+90) tmp = Float64(Float64(z / i) * i); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x))))); tmp = 0.0; if (t_1 <= -2e+305) tmp = i * y; elseif (t_1 <= -4e+90) tmp = (z / i) * i; else tmp = (i * y) + (a + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+305], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -4e+90], N[(N[(z / i), $MachinePrecision] * i), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+305}:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+90}:\\
\;\;\;\;\frac{z}{i} \cdot i\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\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.9999999999999999e305Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64100.0
Applied rewrites100.0%
if -1.9999999999999999e305 < (+.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)) < -3.99999999999999987e90Initial program 99.8%
Taylor expanded in i around -inf
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites61.3%
Taylor expanded in z around inf
Applied rewrites14.4%
if -3.99999999999999987e90 < (+.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.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6477.7
Applied rewrites77.7%
Taylor expanded in y around inf
Applied rewrites39.6%
Final simplification33.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))
-10.0)
(* (+ (/ z i) y) i)
(+ (* i y) (+ a t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))))) <= -10.0) {
tmp = ((z / i) + y) * i;
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((i * y) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))) <= (-10.0d0)) then
tmp = ((z / i) + y) * i
else
tmp = (i * y) + (a + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((i * y) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))))) <= -10.0) {
tmp = ((z / i) + y) * i;
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((i * y) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x)))))) <= -10.0: tmp = ((z / i) + y) * i else: tmp = (i * y) + (a + t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) <= -10.0) tmp = Float64(Float64(Float64(z / i) + y) * i); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))))) <= -10.0) tmp = ((z / i) + y) * i; else tmp = (i * y) + (a + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -10.0], N[(N[(N[(z / i), $MachinePrecision] + y), $MachinePrecision] * i), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right) \leq -10:\\
\;\;\;\;\left(\frac{z}{i} + y\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\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)) < -10Initial program 99.8%
Taylor expanded in i around -inf
*-commutativeN/A
associate-*r*N/A
neg-mul-1N/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites70.1%
Taylor expanded in z around inf
Applied rewrites35.7%
if -10 < (+.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.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6477.0
Applied rewrites77.0%
Taylor expanded in y around inf
Applied rewrites41.1%
Final simplification38.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -2.5e+62)
(fma (+ (fma i y z) (* (log y) x)) 1.0 a)
(if (<= x 1.32e+163)
(fma (- b 0.5) (log c) (+ (+ a t) (fma i y z)))
(+ (fma (- b 0.5) (log c) (fma (log y) x z)) (+ a t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -2.5e+62) {
tmp = fma((fma(i, y, z) + (log(y) * x)), 1.0, a);
} else if (x <= 1.32e+163) {
tmp = fma((b - 0.5), log(c), ((a + t) + fma(i, y, z)));
} else {
tmp = fma((b - 0.5), log(c), fma(log(y), x, z)) + (a + t);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -2.5e+62) tmp = fma(Float64(fma(i, y, z) + Float64(log(y) * x)), 1.0, a); elseif (x <= 1.32e+163) tmp = fma(Float64(b - 0.5), log(c), Float64(Float64(a + t) + fma(i, y, z))); else tmp = Float64(fma(Float64(b - 0.5), log(c), fma(log(y), x, z)) + Float64(a + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2.5e+62], N[(N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * 1.0 + a), $MachinePrecision], If[LessEqual[x, 1.32e+163], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(a + t), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, y, z\right) + \log y \cdot x, 1, a\right)\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{+163}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \left(a + t\right) + \mathsf{fma}\left(i, y, z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, z\right)\right) + \left(a + t\right)\\
\end{array}
\end{array}
if x < -2.50000000000000014e62Initial program 99.8%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
Applied rewrites71.7%
Taylor expanded in x around inf
Applied rewrites62.8%
Applied rewrites83.8%
if -2.50000000000000014e62 < x < 1.31999999999999995e163Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6498.0
Applied rewrites98.0%
Applied rewrites98.0%
if 1.31999999999999995e163 < x Initial program 99.5%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6495.4
Applied rewrites95.4%
Final simplification94.6%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (fma (- b 0.5) (log c) a) (fma (log y) x z)) (* i y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (fma((b - 0.5), log(c), a) + fma(log(y), x, z)) + (i * y);
}
function code(x, y, z, t, a, b, c, i) return Float64(Float64(fma(Float64(b - 0.5), log(c), a) + fma(log(y), x, z)) + Float64(i * y)) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + a), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(b - 0.5, \log c, a\right) + \mathsf{fma}\left(\log y, x, z\right)\right) + i \cdot y
\end{array}
Initial program 99.8%
Taylor expanded in t around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6486.3
Applied rewrites86.3%
Final simplification86.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (+ (fma (- b 0.5) (log c) z) t) a)))
(if (<= (- b 0.5) -4e+181)
t_1
(if (<= (- b 0.5) 6e+149)
(fma (+ (fma i y z) (* (log y) x)) 1.0 a)
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (fma((b - 0.5), log(c), z) + t) + a;
double tmp;
if ((b - 0.5) <= -4e+181) {
tmp = t_1;
} else if ((b - 0.5) <= 6e+149) {
tmp = fma((fma(i, y, z) + (log(y) * x)), 1.0, a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(fma(Float64(b - 0.5), log(c), z) + t) + a) tmp = 0.0 if (Float64(b - 0.5) <= -4e+181) tmp = t_1; elseif (Float64(b - 0.5) <= 6e+149) tmp = fma(Float64(fma(i, y, z) + Float64(log(y) * x)), 1.0, a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[N[(b - 0.5), $MachinePrecision], -4e+181], t$95$1, If[LessEqual[N[(b - 0.5), $MachinePrecision], 6e+149], N[(N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * 1.0 + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(b - 0.5, \log c, z\right) + t\right) + a\\
\mathbf{if}\;b - 0.5 \leq -4 \cdot 10^{+181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b - 0.5 \leq 6 \cdot 10^{+149}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, y, z\right) + \log y \cdot x, 1, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 b #s(literal 1/2 binary64)) < -3.9999999999999997e181 or 6.00000000000000007e149 < (-.f64 b #s(literal 1/2 binary64)) Initial program 99.6%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.6
Applied rewrites92.6%
Taylor expanded in y around 0
Applied rewrites78.6%
if -3.9999999999999997e181 < (-.f64 b #s(literal 1/2 binary64)) < 6.00000000000000007e149Initial program 99.8%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
Applied rewrites75.4%
Taylor expanded in x around inf
Applied rewrites58.6%
Applied rewrites77.5%
Final simplification77.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (+ (fma i y z) (* (log y) x)) 1.0 a)))
(if (<= x -2.5e+62)
t_1
(if (<= x 5.8e+159)
(fma (- b 0.5) (log c) (+ (+ a t) (fma i y 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((fma(i, y, z) + (log(y) * x)), 1.0, a);
double tmp;
if (x <= -2.5e+62) {
tmp = t_1;
} else if (x <= 5.8e+159) {
tmp = fma((b - 0.5), log(c), ((a + t) + fma(i, y, z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(Float64(fma(i, y, z) + Float64(log(y) * x)), 1.0, a) tmp = 0.0 if (x <= -2.5e+62) tmp = t_1; elseif (x <= 5.8e+159) tmp = fma(Float64(b - 0.5), log(c), Float64(Float64(a + t) + fma(i, y, z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * 1.0 + a), $MachinePrecision]}, If[LessEqual[x, -2.5e+62], t$95$1, If[LessEqual[x, 5.8e+159], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(a + t), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(i, y, z\right) + \log y \cdot x, 1, a\right)\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \left(a + t\right) + \mathsf{fma}\left(i, y, z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.50000000000000014e62 or 5.80000000000000029e159 < x Initial program 99.7%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
Applied rewrites71.7%
Taylor expanded in x around inf
Applied rewrites64.2%
Applied rewrites87.0%
if -2.50000000000000014e62 < x < 5.80000000000000029e159Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6498.0
Applied rewrites98.0%
Applied rewrites98.0%
Final simplification94.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (+ (fma i y z) (* (log y) x)) 1.0 a)))
(if (<= x -2.5e+62)
t_1
(if (<= x 5.8e+159)
(+ (fma (- b 0.5) (log c) (fma y i z)) (+ a 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((fma(i, y, z) + (log(y) * x)), 1.0, a);
double tmp;
if (x <= -2.5e+62) {
tmp = t_1;
} else if (x <= 5.8e+159) {
tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (a + t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(Float64(fma(i, y, z) + Float64(log(y) * x)), 1.0, a) tmp = 0.0 if (x <= -2.5e+62) tmp = t_1; elseif (x <= 5.8e+159) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(a + t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * 1.0 + a), $MachinePrecision]}, If[LessEqual[x, -2.5e+62], t$95$1, If[LessEqual[x, 5.8e+159], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(i, y, z\right) + \log y \cdot x, 1, a\right)\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.50000000000000014e62 or 5.80000000000000029e159 < x Initial program 99.7%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
Applied rewrites71.7%
Taylor expanded in x around inf
Applied rewrites64.2%
Applied rewrites87.0%
if -2.50000000000000014e62 < x < 5.80000000000000029e159Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6498.0
Applied rewrites98.0%
Final simplification94.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* (log y) x) (* i y))))
(if (<= x -7.5e+167)
t_1
(if (<= x 9.6e+178) (+ (+ (fma (- b 0.5) (log c) z) t) a) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (log(y) * x) + (i * y);
double tmp;
if (x <= -7.5e+167) {
tmp = t_1;
} else if (x <= 9.6e+178) {
tmp = (fma((b - 0.5), log(c), z) + t) + a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(log(y) * x) + Float64(i * y)) tmp = 0.0 if (x <= -7.5e+167) tmp = t_1; elseif (x <= 9.6e+178) tmp = Float64(Float64(fma(Float64(b - 0.5), log(c), z) + t) + a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.5e+167], t$95$1, If[LessEqual[x, 9.6e+178], N[(N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x + i \cdot y\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+167}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{+178}:\\
\;\;\;\;\left(\mathsf{fma}\left(b - 0.5, \log c, z\right) + t\right) + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.4999999999999995e167 or 9.599999999999999e178 < x Initial program 99.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6477.1
Applied rewrites77.1%
if -7.4999999999999995e167 < x < 9.599999999999999e178Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6494.8
Applied rewrites94.8%
Taylor expanded in y around 0
Applied rewrites74.0%
Final simplification74.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 3.2e+45) (+ (+ (fma (- b 0.5) (log c) z) t) a) (+ (fma -0.5 (log c) (fma y i z)) (+ a t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 3.2e+45) {
tmp = (fma((b - 0.5), log(c), z) + t) + a;
} else {
tmp = fma(-0.5, log(c), fma(y, i, z)) + (a + t);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 3.2e+45) tmp = Float64(Float64(fma(Float64(b - 0.5), log(c), z) + t) + a); else tmp = Float64(fma(-0.5, log(c), fma(y, i, z)) + Float64(a + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 3.2e+45], N[(N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision], N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{+45}:\\
\;\;\;\;\left(\mathsf{fma}\left(b - 0.5, \log c, z\right) + t\right) + a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\end{array}
\end{array}
if y < 3.2000000000000003e45Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6482.0
Applied rewrites82.0%
Taylor expanded in y around 0
Applied rewrites76.9%
if 3.2000000000000003e45 < y Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6482.8
Applied rewrites82.8%
Taylor expanded in b around 0
Applied rewrites75.4%
Final simplification76.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -8e+158) (fma (/ z a) a a) (+ (* i y) (+ a t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -8e+158) {
tmp = fma((z / a), a, a);
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -8e+158) tmp = fma(Float64(z / a), a, a); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -8e+158], N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+158}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\right)\\
\end{array}
\end{array}
if z < -7.99999999999999962e158Initial program 99.9%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
Applied rewrites67.6%
Taylor expanded in z around inf
Applied rewrites38.7%
if -7.99999999999999962e158 < z Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6480.7
Applied rewrites80.7%
Taylor expanded in y around inf
Applied rewrites48.6%
Final simplification47.4%
(FPCore (x y z t a b c i) :precision binary64 (+ (* i y) (+ a t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + (a + t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (i * y) + (a + t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + (a + t);
}
def code(x, y, z, t, a, b, c, i): return (i * y) + (a + t)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(i * y) + Float64(a + t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (i * y) + (a + t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
i \cdot y + \left(a + t\right)
\end{array}
Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6482.3
Applied rewrites82.3%
Taylor expanded in y around inf
Applied rewrites46.4%
Final simplification46.4%
(FPCore (x y z t a b c i) :precision binary64 (* i y))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return i * y;
}
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 = i * y
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return i * y;
}
def code(x, y, z, t, a, b, c, i): return i * y
function code(x, y, z, t, a, b, c, i) return Float64(i * y) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = i * y; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(i * y), $MachinePrecision]
\begin{array}{l}
\\
i \cdot y
\end{array}
Initial program 99.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6419.9
Applied rewrites19.9%
Final simplification19.9%
herbie shell --seed 2024277
(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)))