
(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 15 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 (log c) (- b 0.5) (+ (+ (fma (log y) x z) t) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(y, i, fma(log(c), (b - 0.5), ((fma(log(y), x, z) + t) + a)));
}
function code(x, y, z, t, a, b, c, i) return fma(y, i, fma(log(c), Float64(b - 0.5), Float64(Float64(fma(log(y), x, z) + t) + a))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[(N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(\mathsf{fma}\left(\log y, x, z\right) + t\right) + a\right)\right)
\end{array}
Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* i y)
(+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))))))
(if (<= t_1 -5e+258)
(* i y)
(if (<= t_1 -5e+94) (* (/ z i) 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 = (i * y) + (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c)));
double tmp;
if (t_1 <= -5e+258) {
tmp = i * y;
} else if (t_1 <= -5e+94) {
tmp = (z / i) * i;
} else {
tmp = ((a / i) + 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 = (i * y) + (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c)))
if (t_1 <= (-5d+258)) then
tmp = i * y
else if (t_1 <= (-5d+94)) then
tmp = (z / i) * i
else
tmp = ((a / i) + 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 = (i * y) + (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c)));
double tmp;
if (t_1 <= -5e+258) {
tmp = i * y;
} else if (t_1 <= -5e+94) {
tmp = (z / i) * i;
} else {
tmp = ((a / i) + y) * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (i * y) + (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) tmp = 0 if t_1 <= -5e+258: tmp = i * y elif t_1 <= -5e+94: tmp = (z / i) * i else: tmp = ((a / i) + y) * i return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(i * y) + Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c)))) tmp = 0.0 if (t_1 <= -5e+258) tmp = Float64(i * y); elseif (t_1 <= -5e+94) tmp = Float64(Float64(z / i) * i); else tmp = Float64(Float64(Float64(a / i) + y) * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (i * y) + (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))); tmp = 0.0; if (t_1 <= -5e+258) tmp = i * y; elseif (t_1 <= -5e+94) tmp = (z / i) * i; else tmp = ((a / i) + y) * i; 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[(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]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+258], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -5e+94], N[(N[(z / i), $MachinePrecision] * i), $MachinePrecision], N[(N[(N[(a / i), $MachinePrecision] + y), $MachinePrecision] * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+258}:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+94}:\\
\;\;\;\;\frac{z}{i} \cdot i\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{a}{i} + y\right) \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)) < -5e258Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6445.3
Applied rewrites45.3%
if -5e258 < (+.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)) < -5.0000000000000001e94Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites66.7%
Taylor expanded in z around inf
Applied rewrites10.6%
if -5.0000000000000001e94 < (+.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
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites69.3%
Taylor expanded in a around inf
Applied rewrites33.6%
Final simplification31.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y i (* b (log c)))) (t_2 (* (- b 0.5) (log c))))
(if (<= t_2 -1e+147)
t_1
(if (<= t_2 2e+167) (fma y i (fma (log c) -0.5 (+ (+ 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 = fma(y, i, (b * log(c)));
double t_2 = (b - 0.5) * log(c);
double tmp;
if (t_2 <= -1e+147) {
tmp = t_1;
} else if (t_2 <= 2e+167) {
tmp = fma(y, i, fma(log(c), -0.5, ((z + t) + a)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, i, Float64(b * log(c))) t_2 = Float64(Float64(b - 0.5) * log(c)) tmp = 0.0 if (t_2 <= -1e+147) tmp = t_1; elseif (t_2 <= 2e+167) tmp = fma(y, i, fma(log(c), -0.5, Float64(Float64(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[(y * i + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+147], t$95$1, If[LessEqual[t$95$2, 2e+167], N[(y * i + N[(N[Log[c], $MachinePrecision] * -0.5 + N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, b \cdot \log c\right)\\
t_2 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+167}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, -0.5, \left(z + t\right) + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -9.9999999999999998e146 or 2.0000000000000001e167 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6476.0
Applied rewrites76.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6476.0
Applied rewrites76.0%
if -9.9999999999999998e146 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 2.0000000000000001e167Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6483.7
Applied rewrites83.7%
Taylor expanded in b around 0
Applied rewrites79.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (* i y) (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))))
-100.0)
(fma y i (* (/ z x) x))
(fma y i (* (/ a x) x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((i * y) + (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c)))) <= -100.0) {
tmp = fma(y, i, ((z / x) * x));
} else {
tmp = fma(y, i, ((a / x) * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(i * y) + Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c)))) <= -100.0) tmp = fma(y, i, Float64(Float64(z / x) * x)); else tmp = fma(y, i, Float64(Float64(a / x) * x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(i * y), $MachinePrecision] + 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]), $MachinePrecision], -100.0], N[(y * i + N[(N[(z / x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[(a / x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) \leq -100:\\
\;\;\;\;\mathsf{fma}\left(y, i, \frac{z}{x} \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \frac{a}{x} \cdot x\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
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.3%
Taylor expanded in z around inf
Applied rewrites36.2%
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
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.8%
Taylor expanded in a around inf
Applied rewrites32.2%
Final simplification34.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (* i y) (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))))
-100.0)
(* (+ (/ z i) y) i)
(fma y i (* (/ a x) x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((i * y) + (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c)))) <= -100.0) {
tmp = ((z / i) + y) * i;
} else {
tmp = fma(y, i, ((a / x) * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(i * y) + Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c)))) <= -100.0) tmp = Float64(Float64(Float64(z / i) + y) * i); else tmp = fma(y, i, Float64(Float64(a / x) * x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(i * y), $MachinePrecision] + 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]), $MachinePrecision], -100.0], N[(N[(N[(z / i), $MachinePrecision] + y), $MachinePrecision] * i), $MachinePrecision], N[(y * i + N[(N[(a / x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) \leq -100:\\
\;\;\;\;\left(\frac{z}{i} + y\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \frac{a}{x} \cdot x\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
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites68.7%
Taylor expanded in z around inf
Applied rewrites33.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)) Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.8%
Taylor expanded in a around inf
Applied rewrites32.2%
Final simplification32.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (* i y) (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))))
-100.0)
(* (+ (/ z i) y) 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 (((i * y) + (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c)))) <= -100.0) {
tmp = ((z / i) + y) * i;
} else {
tmp = ((a / i) + 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 (((i * y) + (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c)))) <= (-100.0d0)) then
tmp = ((z / i) + y) * i
else
tmp = ((a / i) + 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 (((i * y) + (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c)))) <= -100.0) {
tmp = ((z / i) + y) * i;
} else {
tmp = ((a / i) + y) * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((i * y) + (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c)))) <= -100.0: tmp = ((z / i) + y) * i else: tmp = ((a / i) + y) * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(i * y) + Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c)))) <= -100.0) tmp = Float64(Float64(Float64(z / i) + y) * i); else tmp = Float64(Float64(Float64(a / i) + y) * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((i * y) + (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c)))) <= -100.0) tmp = ((z / i) + y) * i; else tmp = ((a / i) + y) * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(i * y), $MachinePrecision] + 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]), $MachinePrecision], -100.0], N[(N[(N[(z / i), $MachinePrecision] + y), $MachinePrecision] * i), $MachinePrecision], N[(N[(N[(a / i), $MachinePrecision] + y), $MachinePrecision] * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) \leq -100:\\
\;\;\;\;\left(\frac{z}{i} + y\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{a}{i} + y\right) \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)) < -100Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites68.7%
Taylor expanded in z around inf
Applied rewrites33.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)) Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites66.3%
Taylor expanded in a around inf
Applied rewrites34.7%
Final simplification34.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 3.9e-84) (+ (fma (- b 0.5) (log c) (fma (log y) x z)) (+ t a)) (fma y i (fma (log c) (- b 0.5) (+ (+ z t) a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 3.9e-84) {
tmp = fma((b - 0.5), log(c), fma(log(y), x, z)) + (t + a);
} else {
tmp = fma(y, i, fma(log(c), (b - 0.5), ((z + t) + a)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 3.9e-84) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(log(y), x, z)) + Float64(t + a)); else tmp = fma(y, i, fma(log(c), Float64(b - 0.5), Float64(Float64(z + t) + a))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 3.9e-84], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.9 \cdot 10^{-84}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, z\right)\right) + \left(t + a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(z + t\right) + a\right)\right)\\
\end{array}
\end{array}
if y < 3.90000000000000023e-84Initial program 99.9%
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.f6497.9
Applied rewrites97.9%
if 3.90000000000000023e-84 < y Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6492.4
Applied rewrites92.4%
Final simplification94.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -3.7e+243)
(fma y i (* (+ (/ z x) (log y)) x))
(if (<= x 6e+223)
(fma y i (fma (log c) (- b 0.5) (+ (+ z t) a)))
(fma y i (fma (log y) x (* (/ a x) x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -3.7e+243) {
tmp = fma(y, i, (((z / x) + log(y)) * x));
} else if (x <= 6e+223) {
tmp = fma(y, i, fma(log(c), (b - 0.5), ((z + t) + a)));
} else {
tmp = fma(y, i, fma(log(y), x, ((a / x) * x)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -3.7e+243) tmp = fma(y, i, Float64(Float64(Float64(z / x) + log(y)) * x)); elseif (x <= 6e+223) tmp = fma(y, i, fma(log(c), Float64(b - 0.5), Float64(Float64(z + t) + a))); else tmp = fma(y, i, fma(log(y), x, Float64(Float64(a / x) * x))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -3.7e+243], N[(y * i + N[(N[(N[(z / x), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e+223], N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[Log[y], $MachinePrecision] * x + N[(N[(a / x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{+243}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\frac{z}{x} + \log y\right) \cdot x\right)\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+223}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(z + t\right) + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log y, x, \frac{a}{x} \cdot x\right)\right)\\
\end{array}
\end{array}
if x < -3.7000000000000002e243Initial program 100.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in z around inf
Applied rewrites75.0%
if -3.7000000000000002e243 < x < 6.00000000000000002e223Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6492.6
Applied rewrites92.6%
if 6.00000000000000002e223 < x Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.7%
Taylor expanded in a around inf
Applied rewrites83.2%
Applied rewrites83.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -3.7e+243)
(fma y i (* (+ (/ z x) (log y)) x))
(if (<= x 6e+223)
(fma y i (fma (log c) (- b 0.5) (+ (+ z t) a)))
(fma y i (* (+ (/ a x) (log y)) x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -3.7e+243) {
tmp = fma(y, i, (((z / x) + log(y)) * x));
} else if (x <= 6e+223) {
tmp = fma(y, i, fma(log(c), (b - 0.5), ((z + t) + a)));
} else {
tmp = fma(y, i, (((a / x) + log(y)) * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -3.7e+243) tmp = fma(y, i, Float64(Float64(Float64(z / x) + log(y)) * x)); elseif (x <= 6e+223) tmp = fma(y, i, fma(log(c), Float64(b - 0.5), Float64(Float64(z + t) + a))); else tmp = fma(y, i, Float64(Float64(Float64(a / x) + log(y)) * x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -3.7e+243], N[(y * i + N[(N[(N[(z / x), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e+223], N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[(N[(a / x), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{+243}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\frac{z}{x} + \log y\right) \cdot x\right)\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+223}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(z + t\right) + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\frac{a}{x} + \log y\right) \cdot x\right)\\
\end{array}
\end{array}
if x < -3.7000000000000002e243Initial program 100.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in z around inf
Applied rewrites75.0%
if -3.7000000000000002e243 < x < 6.00000000000000002e223Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6492.6
Applied rewrites92.6%
if 6.00000000000000002e223 < x Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.7%
Taylor expanded in a around inf
Applied rewrites83.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y i (* (+ (/ a x) (log y)) x))))
(if (<= x -1.02e+119)
t_1
(if (<= x 6e+223) (fma y i (fma (log c) (- b 0.5) (+ (+ 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 = fma(y, i, (((a / x) + log(y)) * x));
double tmp;
if (x <= -1.02e+119) {
tmp = t_1;
} else if (x <= 6e+223) {
tmp = fma(y, i, fma(log(c), (b - 0.5), ((z + t) + a)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, i, Float64(Float64(Float64(a / x) + log(y)) * x)) tmp = 0.0 if (x <= -1.02e+119) tmp = t_1; elseif (x <= 6e+223) tmp = fma(y, i, fma(log(c), Float64(b - 0.5), Float64(Float64(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[(y * i + N[(N[(N[(a / x), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.02e+119], t$95$1, If[LessEqual[x, 6e+223], N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, \left(\frac{a}{x} + \log y\right) \cdot x\right)\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+223}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(z + t\right) + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.02e119 or 6.00000000000000002e223 < x Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.7%
Taylor expanded in a around inf
Applied rewrites67.3%
if -1.02e119 < x < 6.00000000000000002e223Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6497.2
Applied rewrites97.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x 9.5e+272) (fma y i (fma (log c) (- b 0.5) (+ (+ z t) a))) (* x (log y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= 9.5e+272) {
tmp = fma(y, i, fma(log(c), (b - 0.5), ((z + t) + a)));
} else {
tmp = x * log(y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= 9.5e+272) tmp = fma(y, i, fma(log(c), Float64(b - 0.5), Float64(Float64(z + t) + a))); else tmp = Float64(x * log(y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, 9.5e+272], N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.5 \cdot 10^{+272}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(z + t\right) + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y\\
\end{array}
\end{array}
if x < 9.5e272Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6488.8
Applied rewrites88.8%
if 9.5e272 < x Initial program 99.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6462.5
Applied rewrites62.5%
Final simplification87.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x 9.5e+272) (+ (fma (- b 0.5) (log c) (fma y i z)) (+ t a)) (* x (log y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= 9.5e+272) {
tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (t + a);
} else {
tmp = x * log(y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= 9.5e+272) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(t + a)); else tmp = Float64(x * log(y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, 9.5e+272], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.5 \cdot 10^{+272}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(t + a\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y\\
\end{array}
\end{array}
if x < 9.5e272Initial 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.f6488.8
Applied rewrites88.8%
if 9.5e272 < x Initial program 99.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6462.5
Applied rewrites62.5%
Final simplification87.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 4.8e-208) (* (/ z i) i) (if (<= y 1.8e+46) (* (/ a i) i) (* i y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 4.8e-208) {
tmp = (z / i) * i;
} else if (y <= 1.8e+46) {
tmp = (a / i) * i;
} else {
tmp = i * y;
}
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 <= 4.8d-208) then
tmp = (z / i) * i
else if (y <= 1.8d+46) then
tmp = (a / i) * i
else
tmp = i * y
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 <= 4.8e-208) {
tmp = (z / i) * i;
} else if (y <= 1.8e+46) {
tmp = (a / i) * i;
} else {
tmp = i * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 4.8e-208: tmp = (z / i) * i elif y <= 1.8e+46: tmp = (a / i) * i else: tmp = i * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 4.8e-208) tmp = Float64(Float64(z / i) * i); elseif (y <= 1.8e+46) tmp = Float64(Float64(a / i) * i); else tmp = Float64(i * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= 4.8e-208) tmp = (z / i) * i; elseif (y <= 1.8e+46) tmp = (a / i) * i; else tmp = i * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 4.8e-208], N[(N[(z / i), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[y, 1.8e+46], N[(N[(a / i), $MachinePrecision] * i), $MachinePrecision], N[(i * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{-208}:\\
\;\;\;\;\frac{z}{i} \cdot i\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+46}:\\
\;\;\;\;\frac{a}{i} \cdot i\\
\mathbf{else}:\\
\;\;\;\;i \cdot y\\
\end{array}
\end{array}
if y < 4.7999999999999998e-208Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites63.6%
Taylor expanded in z around inf
Applied rewrites9.2%
if 4.7999999999999998e-208 < y < 1.7999999999999999e46Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
Applied rewrites15.8%
if 1.7999999999999999e46 < y Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6453.9
Applied rewrites53.9%
Final simplification30.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 1.8e+46) (* (/ a i) i) (* i y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 1.8e+46) {
tmp = (a / i) * i;
} else {
tmp = i * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (y <= 1.8d+46) then
tmp = (a / i) * i
else
tmp = i * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 1.8e+46) {
tmp = (a / i) * i;
} else {
tmp = i * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 1.8e+46: tmp = (a / i) * i else: tmp = i * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 1.8e+46) tmp = Float64(Float64(a / i) * i); else tmp = Float64(i * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= 1.8e+46) tmp = (a / i) * i; else tmp = i * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 1.8e+46], N[(N[(a / i), $MachinePrecision] * i), $MachinePrecision], N[(i * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{+46}:\\
\;\;\;\;\frac{a}{i} \cdot i\\
\mathbf{else}:\\
\;\;\;\;i \cdot y\\
\end{array}
\end{array}
if y < 1.7999999999999999e46Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in a around inf
Applied rewrites14.9%
if 1.7999999999999999e46 < y Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6453.9
Applied rewrites53.9%
Final simplification31.7%
(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.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6427.5
Applied rewrites27.5%
Final simplification27.5%
herbie shell --seed 2024268
(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)))