
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
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
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
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
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
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
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Initial program 96.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_1 -2e+161)
(/ x (fma t (fma t (* 0.5 (* y y)) y) 1.0))
(if (<= t_1 -20000000000000.0)
(* t (* (* x (* y y)) (* t 0.5)))
(if (<= t_1 1e-23)
(fma (* x a) (- (- z) b) x)
(if (<= t_1 1e+124)
(*
x
(fma
y
(fma y (* y (* -0.16666666666666666 (* t (* t t)))) (- t))
1.0))
(if (<= t_1 5e+295)
(* x (fma t (fma 0.5 (* t (* y y)) (- y)) 1.0))
(* x (fma b (fma (* 0.5 (* a a)) b (- a)) 1.0)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_1 <= -2e+161) {
tmp = x / fma(t, fma(t, (0.5 * (y * y)), y), 1.0);
} else if (t_1 <= -20000000000000.0) {
tmp = t * ((x * (y * y)) * (t * 0.5));
} else if (t_1 <= 1e-23) {
tmp = fma((x * a), (-z - b), x);
} else if (t_1 <= 1e+124) {
tmp = x * fma(y, fma(y, (y * (-0.16666666666666666 * (t * (t * t)))), -t), 1.0);
} else if (t_1 <= 5e+295) {
tmp = x * fma(t, fma(0.5, (t * (y * y)), -y), 1.0);
} else {
tmp = x * fma(b, fma((0.5 * (a * a)), b, -a), 1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_1 <= -2e+161) tmp = Float64(x / fma(t, fma(t, Float64(0.5 * Float64(y * y)), y), 1.0)); elseif (t_1 <= -20000000000000.0) tmp = Float64(t * Float64(Float64(x * Float64(y * y)) * Float64(t * 0.5))); elseif (t_1 <= 1e-23) tmp = fma(Float64(x * a), Float64(Float64(-z) - b), x); elseif (t_1 <= 1e+124) tmp = Float64(x * fma(y, fma(y, Float64(y * Float64(-0.16666666666666666 * Float64(t * Float64(t * t)))), Float64(-t)), 1.0)); elseif (t_1 <= 5e+295) tmp = Float64(x * fma(t, fma(0.5, Float64(t * Float64(y * y)), Float64(-y)), 1.0)); else tmp = Float64(x * fma(b, fma(Float64(0.5 * Float64(a * a)), b, Float64(-a)), 1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+161], N[(x / N[(t * N[(t * N[(0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -20000000000000.0], N[(t * N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(t * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-23], N[(N[(x * a), $MachinePrecision] * N[((-z) - b), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+124], N[(x * N[(y * N[(y * N[(y * N[(-0.16666666666666666 * N[(t * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-t)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+295], N[(x * N[(t * N[(0.5 * N[(t * N[(y * y), $MachinePrecision]), $MachinePrecision] + (-y)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(b * N[(N[(0.5 * N[(a * a), $MachinePrecision]), $MachinePrecision] * b + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+161}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, \mathsf{fma}\left(t, 0.5 \cdot \left(y \cdot y\right), y\right), 1\right)}\\
\mathbf{elif}\;t\_1 \leq -20000000000000:\\
\;\;\;\;t \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot 0.5\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot a, \left(-z\right) - b, x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+124}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(y, y \cdot \left(-0.16666666666666666 \cdot \left(t \cdot \left(t \cdot t\right)\right)\right), -t\right), 1\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+295}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(t, \mathsf{fma}\left(0.5, t \cdot \left(y \cdot y\right), -y\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5 \cdot \left(a \cdot a\right), b, -a\right), 1\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2.0000000000000001e161Initial program 98.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6454.4
Applied rewrites54.4%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6454.4
Applied rewrites54.4%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
associate-*l*N/A
associate-*r*N/A
unpow2N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-+l+N/A
*-commutativeN/A
distribute-rgt-inN/A
Applied rewrites64.3%
if -2.0000000000000001e161 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e13Initial program 89.1%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6436.5
Applied rewrites36.5%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f643.8
Applied rewrites3.8%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.3
Applied rewrites29.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.7
Applied rewrites51.7%
if -2e13 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999996e-24Initial program 92.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6495.7
Applied rewrites95.7%
Taylor expanded in z around 0
lower--.f64N/A
mul-1-negN/A
lower-neg.f6495.7
Applied rewrites95.7%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-inN/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6488.9
Applied rewrites88.9%
if 9.9999999999999996e-24 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.99999999999999948e123Initial program 94.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6463.1
Applied rewrites63.1%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites41.2%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6440.8
Applied rewrites40.8%
if 9.99999999999999948e123 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.99999999999999991e295Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6450.1
Applied rewrites50.1%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6470.7
Applied rewrites70.7%
if 4.99999999999999991e295 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.8%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in b around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6470.0
Applied rewrites70.0%
Final simplification66.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))
(t_2 (* t (* (* x (* y y)) (* t 0.5)))))
(if (<= t_1 (- INFINITY))
(/ x (fma t y 1.0))
(if (<= t_1 -20000000000000.0)
t_2
(if (<= t_1 5.0)
(fma (* x a) (- (- z) b) x)
(if (<= t_1 2e+115)
(* y (* y (* 0.5 (* x (* t t)))))
(if (<= t_1 5e+295)
t_2
(* x (fma b (fma (* 0.5 (* a a)) b (- a)) 1.0)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double t_2 = t * ((x * (y * y)) * (t * 0.5));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x / fma(t, y, 1.0);
} else if (t_1 <= -20000000000000.0) {
tmp = t_2;
} else if (t_1 <= 5.0) {
tmp = fma((x * a), (-z - b), x);
} else if (t_1 <= 2e+115) {
tmp = y * (y * (0.5 * (x * (t * t))));
} else if (t_1 <= 5e+295) {
tmp = t_2;
} else {
tmp = x * fma(b, fma((0.5 * (a * a)), b, -a), 1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) t_2 = Float64(t * Float64(Float64(x * Float64(y * y)) * Float64(t * 0.5))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x / fma(t, y, 1.0)); elseif (t_1 <= -20000000000000.0) tmp = t_2; elseif (t_1 <= 5.0) tmp = fma(Float64(x * a), Float64(Float64(-z) - b), x); elseif (t_1 <= 2e+115) tmp = Float64(y * Float64(y * Float64(0.5 * Float64(x * Float64(t * t))))); elseif (t_1 <= 5e+295) tmp = t_2; else tmp = Float64(x * fma(b, fma(Float64(0.5 * Float64(a * a)), b, Float64(-a)), 1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(t * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x / N[(t * y + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -20000000000000.0], t$95$2, If[LessEqual[t$95$1, 5.0], N[(N[(x * a), $MachinePrecision] * N[((-z) - b), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+115], N[(y * N[(y * N[(0.5 * N[(x * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+295], t$95$2, N[(x * N[(b * N[(N[(0.5 * N[(a * a), $MachinePrecision]), $MachinePrecision] * b + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
t_2 := t \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot 0.5\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, y, 1\right)}\\
\mathbf{elif}\;t\_1 \leq -20000000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5:\\
\;\;\;\;\mathsf{fma}\left(x \cdot a, \left(-z\right) - b, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+115}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.5 \cdot \left(x \cdot \left(t \cdot t\right)\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+295}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5 \cdot \left(a \cdot a\right), b, -a\right), 1\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -inf.0Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6469.1
Applied rewrites69.1%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6469.1
Applied rewrites69.1%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6463.9
Applied rewrites63.9%
if -inf.0 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e13 or 2e115 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.99999999999999991e295Initial program 97.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6443.7
Applied rewrites43.7%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6422.3
Applied rewrites22.3%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.9
Applied rewrites37.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6454.1
Applied rewrites54.1%
if -2e13 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 5Initial program 92.6%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6491.9
Applied rewrites91.9%
Taylor expanded in z around 0
lower--.f64N/A
mul-1-negN/A
lower-neg.f6491.9
Applied rewrites91.9%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-inN/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6485.6
Applied rewrites85.6%
if 5 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2e115Initial program 93.4%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6463.2
Applied rewrites63.2%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6429.9
Applied rewrites29.9%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6412.2
Applied rewrites12.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6436.2
Applied rewrites36.2%
if 4.99999999999999991e295 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.8%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in b around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6470.0
Applied rewrites70.0%
Final simplification62.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_1 -2e+161)
(/
x
(fma t (fma t (* (* y y) (fma (* t 0.16666666666666666) y 0.5)) y) 1.0))
(if (<= t_1 -20000000000000.0)
(* t (* (* x (* y y)) (* t 0.5)))
(if (<= t_1 2e+154)
(* x (pow z y))
(if (<= t_1 5e+295)
(* x (fma t (fma 0.5 (* t (* y y)) (- y)) 1.0))
(* x (fma b (fma (* 0.5 (* a a)) b (- a)) 1.0))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_1 <= -2e+161) {
tmp = x / fma(t, fma(t, ((y * y) * fma((t * 0.16666666666666666), y, 0.5)), y), 1.0);
} else if (t_1 <= -20000000000000.0) {
tmp = t * ((x * (y * y)) * (t * 0.5));
} else if (t_1 <= 2e+154) {
tmp = x * pow(z, y);
} else if (t_1 <= 5e+295) {
tmp = x * fma(t, fma(0.5, (t * (y * y)), -y), 1.0);
} else {
tmp = x * fma(b, fma((0.5 * (a * a)), b, -a), 1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_1 <= -2e+161) tmp = Float64(x / fma(t, fma(t, Float64(Float64(y * y) * fma(Float64(t * 0.16666666666666666), y, 0.5)), y), 1.0)); elseif (t_1 <= -20000000000000.0) tmp = Float64(t * Float64(Float64(x * Float64(y * y)) * Float64(t * 0.5))); elseif (t_1 <= 2e+154) tmp = Float64(x * (z ^ y)); elseif (t_1 <= 5e+295) tmp = Float64(x * fma(t, fma(0.5, Float64(t * Float64(y * y)), Float64(-y)), 1.0)); else tmp = Float64(x * fma(b, fma(Float64(0.5 * Float64(a * a)), b, Float64(-a)), 1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+161], N[(x / N[(t * N[(t * N[(N[(y * y), $MachinePrecision] * N[(N[(t * 0.16666666666666666), $MachinePrecision] * y + 0.5), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -20000000000000.0], N[(t * N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(t * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+154], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+295], N[(x * N[(t * N[(0.5 * N[(t * N[(y * y), $MachinePrecision]), $MachinePrecision] + (-y)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(b * N[(N[(0.5 * N[(a * a), $MachinePrecision]), $MachinePrecision] * b + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+161}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, \mathsf{fma}\left(t, \left(y \cdot y\right) \cdot \mathsf{fma}\left(t \cdot 0.16666666666666666, y, 0.5\right), y\right), 1\right)}\\
\mathbf{elif}\;t\_1 \leq -20000000000000:\\
\;\;\;\;t \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot 0.5\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+154}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+295}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(t, \mathsf{fma}\left(0.5, t \cdot \left(y \cdot y\right), -y\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5 \cdot \left(a \cdot a\right), b, -a\right), 1\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2.0000000000000001e161Initial program 98.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6454.4
Applied rewrites54.4%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6454.4
Applied rewrites54.4%
Taylor expanded in y around 0
Applied rewrites65.7%
if -2.0000000000000001e161 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e13Initial program 89.1%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6436.5
Applied rewrites36.5%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f643.8
Applied rewrites3.8%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.3
Applied rewrites29.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.7
Applied rewrites51.7%
if -2e13 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2.00000000000000007e154Initial program 93.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6483.1
Applied rewrites83.1%
Taylor expanded in t around 0
lower-*.f64N/A
lower-pow.f6462.1
Applied rewrites62.1%
if 2.00000000000000007e154 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.99999999999999991e295Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6451.2
Applied rewrites51.2%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6477.1
Applied rewrites77.1%
if 4.99999999999999991e295 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.8%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in b around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6470.0
Applied rewrites70.0%
Final simplification66.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_1 -2e+161)
(/ x (fma t (fma t (* 0.5 (* y y)) y) 1.0))
(if (<= t_1 -2000.0)
(* t (* (* x (* y y)) (* t 0.5)))
(if (<= t_1 1e+147)
(*
x
(fma
y
(* t (fma t (* y (fma t (* y -0.16666666666666666) 0.5)) -1.0))
1.0))
(if (<= t_1 5e+295)
(* x (fma t (fma 0.5 (* t (* y y)) (- y)) 1.0))
(* x (fma b (fma (* 0.5 (* a a)) b (- a)) 1.0))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_1 <= -2e+161) {
tmp = x / fma(t, fma(t, (0.5 * (y * y)), y), 1.0);
} else if (t_1 <= -2000.0) {
tmp = t * ((x * (y * y)) * (t * 0.5));
} else if (t_1 <= 1e+147) {
tmp = x * fma(y, (t * fma(t, (y * fma(t, (y * -0.16666666666666666), 0.5)), -1.0)), 1.0);
} else if (t_1 <= 5e+295) {
tmp = x * fma(t, fma(0.5, (t * (y * y)), -y), 1.0);
} else {
tmp = x * fma(b, fma((0.5 * (a * a)), b, -a), 1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_1 <= -2e+161) tmp = Float64(x / fma(t, fma(t, Float64(0.5 * Float64(y * y)), y), 1.0)); elseif (t_1 <= -2000.0) tmp = Float64(t * Float64(Float64(x * Float64(y * y)) * Float64(t * 0.5))); elseif (t_1 <= 1e+147) tmp = Float64(x * fma(y, Float64(t * fma(t, Float64(y * fma(t, Float64(y * -0.16666666666666666), 0.5)), -1.0)), 1.0)); elseif (t_1 <= 5e+295) tmp = Float64(x * fma(t, fma(0.5, Float64(t * Float64(y * y)), Float64(-y)), 1.0)); else tmp = Float64(x * fma(b, fma(Float64(0.5 * Float64(a * a)), b, Float64(-a)), 1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+161], N[(x / N[(t * N[(t * N[(0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2000.0], N[(t * N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(t * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+147], N[(x * N[(y * N[(t * N[(t * N[(y * N[(t * N[(y * -0.16666666666666666), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+295], N[(x * N[(t * N[(0.5 * N[(t * N[(y * y), $MachinePrecision]), $MachinePrecision] + (-y)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(b * N[(N[(0.5 * N[(a * a), $MachinePrecision]), $MachinePrecision] * b + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+161}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, \mathsf{fma}\left(t, 0.5 \cdot \left(y \cdot y\right), y\right), 1\right)}\\
\mathbf{elif}\;t\_1 \leq -2000:\\
\;\;\;\;t \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot 0.5\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+147}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(y, t \cdot \mathsf{fma}\left(t, y \cdot \mathsf{fma}\left(t, y \cdot -0.16666666666666666, 0.5\right), -1\right), 1\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+295}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(t, \mathsf{fma}\left(0.5, t \cdot \left(y \cdot y\right), -y\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5 \cdot \left(a \cdot a\right), b, -a\right), 1\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2.0000000000000001e161Initial program 98.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6454.4
Applied rewrites54.4%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6454.4
Applied rewrites54.4%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
associate-*l*N/A
associate-*r*N/A
unpow2N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-+l+N/A
*-commutativeN/A
distribute-rgt-inN/A
Applied rewrites64.3%
if -2.0000000000000001e161 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e3Initial program 89.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6439.8
Applied rewrites39.8%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f643.9
Applied rewrites3.9%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6428.0
Applied rewrites28.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.2
Applied rewrites49.2%
if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999998e146Initial program 93.4%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6478.0
Applied rewrites78.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites58.9%
Taylor expanded in t around 0
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6460.7
Applied rewrites60.7%
if 9.9999999999999998e146 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.99999999999999991e295Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6448.8
Applied rewrites48.8%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6473.4
Applied rewrites73.4%
if 4.99999999999999991e295 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.8%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in b around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6470.0
Applied rewrites70.0%
Final simplification64.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))
(t_2 (* t (* (* x (* y y)) (* t 0.5)))))
(if (<= t_1 (- INFINITY))
(/ x (fma t y 1.0))
(if (<= t_1 -20000000000000.0)
t_2
(if (<= t_1 5.0)
(fma (* x a) (- (- z) b) x)
(if (<= t_1 2e+115) (* y (* y (* 0.5 (* x (* t t))))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double t_2 = t * ((x * (y * y)) * (t * 0.5));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x / fma(t, y, 1.0);
} else if (t_1 <= -20000000000000.0) {
tmp = t_2;
} else if (t_1 <= 5.0) {
tmp = fma((x * a), (-z - b), x);
} else if (t_1 <= 2e+115) {
tmp = y * (y * (0.5 * (x * (t * t))));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) t_2 = Float64(t * Float64(Float64(x * Float64(y * y)) * Float64(t * 0.5))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x / fma(t, y, 1.0)); elseif (t_1 <= -20000000000000.0) tmp = t_2; elseif (t_1 <= 5.0) tmp = fma(Float64(x * a), Float64(Float64(-z) - b), x); elseif (t_1 <= 2e+115) tmp = Float64(y * Float64(y * Float64(0.5 * Float64(x * Float64(t * t))))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(t * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x / N[(t * y + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -20000000000000.0], t$95$2, If[LessEqual[t$95$1, 5.0], N[(N[(x * a), $MachinePrecision] * N[((-z) - b), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+115], N[(y * N[(y * N[(0.5 * N[(x * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
t_2 := t \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot 0.5\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, y, 1\right)}\\
\mathbf{elif}\;t\_1 \leq -20000000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5:\\
\;\;\;\;\mathsf{fma}\left(x \cdot a, \left(-z\right) - b, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+115}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.5 \cdot \left(x \cdot \left(t \cdot t\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -inf.0Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6469.1
Applied rewrites69.1%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6469.1
Applied rewrites69.1%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6463.9
Applied rewrites63.9%
if -inf.0 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e13 or 2e115 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.3%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6449.1
Applied rewrites49.1%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6435.0
Applied rewrites35.0%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6443.6
Applied rewrites43.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6454.8
Applied rewrites54.8%
if -2e13 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 5Initial program 92.6%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6491.9
Applied rewrites91.9%
Taylor expanded in z around 0
lower--.f64N/A
mul-1-negN/A
lower-neg.f6491.9
Applied rewrites91.9%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-inN/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6485.6
Applied rewrites85.6%
if 5 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2e115Initial program 93.4%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6463.2
Applied rewrites63.2%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6429.9
Applied rewrites29.9%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6412.2
Applied rewrites12.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6436.2
Applied rewrites36.2%
Final simplification59.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_1 1e-23)
(/
x
(fma t (fma t (* (* y y) (fma (* t 0.16666666666666666) y 0.5)) y) 1.0))
(if (<= t_1 1e+124)
(*
x
(fma
y
(fma
y
(fma (* -0.16666666666666666 (* t (* t t))) y (* 0.5 (* t t)))
(- t))
1.0))
(if (<= t_1 5e+295)
(* x (fma t (fma 0.5 (* t (* y y)) (- y)) 1.0))
(* x (fma b (fma (* 0.5 (* a a)) b (- a)) 1.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_1 <= 1e-23) {
tmp = x / fma(t, fma(t, ((y * y) * fma((t * 0.16666666666666666), y, 0.5)), y), 1.0);
} else if (t_1 <= 1e+124) {
tmp = x * fma(y, fma(y, fma((-0.16666666666666666 * (t * (t * t))), y, (0.5 * (t * t))), -t), 1.0);
} else if (t_1 <= 5e+295) {
tmp = x * fma(t, fma(0.5, (t * (y * y)), -y), 1.0);
} else {
tmp = x * fma(b, fma((0.5 * (a * a)), b, -a), 1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_1 <= 1e-23) tmp = Float64(x / fma(t, fma(t, Float64(Float64(y * y) * fma(Float64(t * 0.16666666666666666), y, 0.5)), y), 1.0)); elseif (t_1 <= 1e+124) tmp = Float64(x * fma(y, fma(y, fma(Float64(-0.16666666666666666 * Float64(t * Float64(t * t))), y, Float64(0.5 * Float64(t * t))), Float64(-t)), 1.0)); elseif (t_1 <= 5e+295) tmp = Float64(x * fma(t, fma(0.5, Float64(t * Float64(y * y)), Float64(-y)), 1.0)); else tmp = Float64(x * fma(b, fma(Float64(0.5 * Float64(a * a)), b, Float64(-a)), 1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-23], N[(x / N[(t * N[(t * N[(N[(y * y), $MachinePrecision] * N[(N[(t * 0.16666666666666666), $MachinePrecision] * y + 0.5), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+124], N[(x * N[(y * N[(y * N[(N[(-0.16666666666666666 * N[(t * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-t)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+295], N[(x * N[(t * N[(0.5 * N[(t * N[(y * y), $MachinePrecision]), $MachinePrecision] + (-y)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(b * N[(N[(0.5 * N[(a * a), $MachinePrecision]), $MachinePrecision] * b + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_1 \leq 10^{-23}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, \mathsf{fma}\left(t, \left(y \cdot y\right) \cdot \mathsf{fma}\left(t \cdot 0.16666666666666666, y, 0.5\right), y\right), 1\right)}\\
\mathbf{elif}\;t\_1 \leq 10^{+124}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(-0.16666666666666666 \cdot \left(t \cdot \left(t \cdot t\right)\right), y, 0.5 \cdot \left(t \cdot t\right)\right), -t\right), 1\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+295}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(t, \mathsf{fma}\left(0.5, t \cdot \left(y \cdot y\right), -y\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5 \cdot \left(a \cdot a\right), b, -a\right), 1\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999996e-24Initial program 95.1%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6464.3
Applied rewrites64.3%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6464.2
Applied rewrites64.2%
Taylor expanded in y around 0
Applied rewrites65.7%
if 9.9999999999999996e-24 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.99999999999999948e123Initial program 94.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6463.1
Applied rewrites63.1%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites41.2%
if 9.99999999999999948e123 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.99999999999999991e295Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6450.1
Applied rewrites50.1%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6470.7
Applied rewrites70.7%
if 4.99999999999999991e295 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.8%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in b around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6470.0
Applied rewrites70.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_1 0.5)
(/
x
(fma t (fma t (* (* y y) (fma (* t 0.16666666666666666) y 0.5)) y) 1.0))
(if (<= t_1 1e+124)
(*
x
(fma y (fma y (* y (* -0.16666666666666666 (* t (* t t)))) (- t)) 1.0))
(if (<= t_1 5e+295)
(* x (fma t (fma 0.5 (* t (* y y)) (- y)) 1.0))
(* x (fma b (fma (* 0.5 (* a a)) b (- a)) 1.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_1 <= 0.5) {
tmp = x / fma(t, fma(t, ((y * y) * fma((t * 0.16666666666666666), y, 0.5)), y), 1.0);
} else if (t_1 <= 1e+124) {
tmp = x * fma(y, fma(y, (y * (-0.16666666666666666 * (t * (t * t)))), -t), 1.0);
} else if (t_1 <= 5e+295) {
tmp = x * fma(t, fma(0.5, (t * (y * y)), -y), 1.0);
} else {
tmp = x * fma(b, fma((0.5 * (a * a)), b, -a), 1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_1 <= 0.5) tmp = Float64(x / fma(t, fma(t, Float64(Float64(y * y) * fma(Float64(t * 0.16666666666666666), y, 0.5)), y), 1.0)); elseif (t_1 <= 1e+124) tmp = Float64(x * fma(y, fma(y, Float64(y * Float64(-0.16666666666666666 * Float64(t * Float64(t * t)))), Float64(-t)), 1.0)); elseif (t_1 <= 5e+295) tmp = Float64(x * fma(t, fma(0.5, Float64(t * Float64(y * y)), Float64(-y)), 1.0)); else tmp = Float64(x * fma(b, fma(Float64(0.5 * Float64(a * a)), b, Float64(-a)), 1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.5], N[(x / N[(t * N[(t * N[(N[(y * y), $MachinePrecision] * N[(N[(t * 0.16666666666666666), $MachinePrecision] * y + 0.5), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+124], N[(x * N[(y * N[(y * N[(y * N[(-0.16666666666666666 * N[(t * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-t)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+295], N[(x * N[(t * N[(0.5 * N[(t * N[(y * y), $MachinePrecision]), $MachinePrecision] + (-y)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(b * N[(N[(0.5 * N[(a * a), $MachinePrecision]), $MachinePrecision] * b + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_1 \leq 0.5:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, \mathsf{fma}\left(t, \left(y \cdot y\right) \cdot \mathsf{fma}\left(t \cdot 0.16666666666666666, y, 0.5\right), y\right), 1\right)}\\
\mathbf{elif}\;t\_1 \leq 10^{+124}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(y, y \cdot \left(-0.16666666666666666 \cdot \left(t \cdot \left(t \cdot t\right)\right)\right), -t\right), 1\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+295}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(t, \mathsf{fma}\left(0.5, t \cdot \left(y \cdot y\right), -y\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5 \cdot \left(a \cdot a\right), b, -a\right), 1\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 0.5Initial program 95.2%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6464.6
Applied rewrites64.6%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6464.6
Applied rewrites64.6%
Taylor expanded in y around 0
Applied rewrites65.7%
if 0.5 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.99999999999999948e123Initial program 94.1%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6461.7
Applied rewrites61.7%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites38.9%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6438.8
Applied rewrites38.8%
if 9.99999999999999948e123 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.99999999999999991e295Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6450.1
Applied rewrites50.1%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6470.7
Applied rewrites70.7%
if 4.99999999999999991e295 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.8%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in b around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6470.0
Applied rewrites70.0%
Final simplification63.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_1 -2e+161)
(/ x (fma t (fma t (* 0.5 (* y y)) y) 1.0))
(if (<= t_1 -20000000000000.0)
(* t (* (* x (* y y)) (* t 0.5)))
(if (<= t_1 5e+295)
(* x (fma t (fma 0.5 (* t (* y y)) (- y)) 1.0))
(* x (fma b (fma (* 0.5 (* a a)) b (- a)) 1.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_1 <= -2e+161) {
tmp = x / fma(t, fma(t, (0.5 * (y * y)), y), 1.0);
} else if (t_1 <= -20000000000000.0) {
tmp = t * ((x * (y * y)) * (t * 0.5));
} else if (t_1 <= 5e+295) {
tmp = x * fma(t, fma(0.5, (t * (y * y)), -y), 1.0);
} else {
tmp = x * fma(b, fma((0.5 * (a * a)), b, -a), 1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_1 <= -2e+161) tmp = Float64(x / fma(t, fma(t, Float64(0.5 * Float64(y * y)), y), 1.0)); elseif (t_1 <= -20000000000000.0) tmp = Float64(t * Float64(Float64(x * Float64(y * y)) * Float64(t * 0.5))); elseif (t_1 <= 5e+295) tmp = Float64(x * fma(t, fma(0.5, Float64(t * Float64(y * y)), Float64(-y)), 1.0)); else tmp = Float64(x * fma(b, fma(Float64(0.5 * Float64(a * a)), b, Float64(-a)), 1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+161], N[(x / N[(t * N[(t * N[(0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -20000000000000.0], N[(t * N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(t * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+295], N[(x * N[(t * N[(0.5 * N[(t * N[(y * y), $MachinePrecision]), $MachinePrecision] + (-y)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(b * N[(N[(0.5 * N[(a * a), $MachinePrecision]), $MachinePrecision] * b + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+161}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, \mathsf{fma}\left(t, 0.5 \cdot \left(y \cdot y\right), y\right), 1\right)}\\
\mathbf{elif}\;t\_1 \leq -20000000000000:\\
\;\;\;\;t \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot 0.5\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+295}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(t, \mathsf{fma}\left(0.5, t \cdot \left(y \cdot y\right), -y\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5 \cdot \left(a \cdot a\right), b, -a\right), 1\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2.0000000000000001e161Initial program 98.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6454.4
Applied rewrites54.4%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6454.4
Applied rewrites54.4%
Taylor expanded in y around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-+l+N/A
associate-*l*N/A
associate-*r*N/A
unpow2N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-+l+N/A
*-commutativeN/A
distribute-rgt-inN/A
Applied rewrites64.3%
if -2.0000000000000001e161 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e13Initial program 89.1%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6436.5
Applied rewrites36.5%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f643.8
Applied rewrites3.8%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.3
Applied rewrites29.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.7
Applied rewrites51.7%
if -2e13 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.99999999999999991e295Initial program 95.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6468.7
Applied rewrites68.7%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6461.1
Applied rewrites61.1%
if 4.99999999999999991e295 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.8%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in b around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6470.0
Applied rewrites70.0%
Final simplification62.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_1 (- INFINITY))
(/ x (fma t y 1.0))
(if (<= t_1 -20000000000000.0)
(* t (* (* x (* y y)) (* t 0.5)))
(if (<= t_1 5e+295)
(* x (fma t (fma 0.5 (* t (* y y)) (- y)) 1.0))
(* x (fma b (fma (* 0.5 (* a a)) b (- a)) 1.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x / fma(t, y, 1.0);
} else if (t_1 <= -20000000000000.0) {
tmp = t * ((x * (y * y)) * (t * 0.5));
} else if (t_1 <= 5e+295) {
tmp = x * fma(t, fma(0.5, (t * (y * y)), -y), 1.0);
} else {
tmp = x * fma(b, fma((0.5 * (a * a)), b, -a), 1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x / fma(t, y, 1.0)); elseif (t_1 <= -20000000000000.0) tmp = Float64(t * Float64(Float64(x * Float64(y * y)) * Float64(t * 0.5))); elseif (t_1 <= 5e+295) tmp = Float64(x * fma(t, fma(0.5, Float64(t * Float64(y * y)), Float64(-y)), 1.0)); else tmp = Float64(x * fma(b, fma(Float64(0.5 * Float64(a * a)), b, Float64(-a)), 1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x / N[(t * y + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -20000000000000.0], N[(t * N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(t * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+295], N[(x * N[(t * N[(0.5 * N[(t * N[(y * y), $MachinePrecision]), $MachinePrecision] + (-y)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(b * N[(N[(0.5 * N[(a * a), $MachinePrecision]), $MachinePrecision] * b + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, y, 1\right)}\\
\mathbf{elif}\;t\_1 \leq -20000000000000:\\
\;\;\;\;t \cdot \left(\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot 0.5\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+295}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(t, \mathsf{fma}\left(0.5, t \cdot \left(y \cdot y\right), -y\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5 \cdot \left(a \cdot a\right), b, -a\right), 1\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -inf.0Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6469.1
Applied rewrites69.1%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6469.1
Applied rewrites69.1%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6463.9
Applied rewrites63.9%
if -inf.0 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e13Initial program 94.5%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6439.1
Applied rewrites39.1%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f642.8
Applied rewrites2.8%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6426.9
Applied rewrites26.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.9
Applied rewrites43.9%
if -2e13 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.99999999999999991e295Initial program 95.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6468.7
Applied rewrites68.7%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6461.1
Applied rewrites61.1%
if 4.99999999999999991e295 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.8%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in b around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6470.0
Applied rewrites70.0%
Final simplification59.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))
(t_2 (* x (* 0.5 (* y (* y (* t t)))))))
(if (<= t_1 -5e+279)
(/ x (fma t y 1.0))
(if (<= t_1 -20000000000000.0)
t_2
(if (<= t_1 0.5) (fma (* x a) (- (- z) b) x) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double t_2 = x * (0.5 * (y * (y * (t * t))));
double tmp;
if (t_1 <= -5e+279) {
tmp = x / fma(t, y, 1.0);
} else if (t_1 <= -20000000000000.0) {
tmp = t_2;
} else if (t_1 <= 0.5) {
tmp = fma((x * a), (-z - b), x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) t_2 = Float64(x * Float64(0.5 * Float64(y * Float64(y * Float64(t * t))))) tmp = 0.0 if (t_1 <= -5e+279) tmp = Float64(x / fma(t, y, 1.0)); elseif (t_1 <= -20000000000000.0) tmp = t_2; elseif (t_1 <= 0.5) tmp = fma(Float64(x * a), Float64(Float64(-z) - b), x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(0.5 * N[(y * N[(y * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+279], N[(x / N[(t * y + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -20000000000000.0], t$95$2, If[LessEqual[t$95$1, 0.5], N[(N[(x * a), $MachinePrecision] * N[((-z) - b), $MachinePrecision] + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
t_2 := x \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot \left(t \cdot t\right)\right)\right)\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+279}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, y, 1\right)}\\
\mathbf{elif}\;t\_1 \leq -20000000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0.5:\\
\;\;\;\;\mathsf{fma}\left(x \cdot a, \left(-z\right) - b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -5.0000000000000002e279Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6464.9
Applied rewrites64.9%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6464.9
Applied rewrites64.9%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6456.1
Applied rewrites56.1%
if -5.0000000000000002e279 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e13 or 0.5 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 96.5%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6452.0
Applied rewrites52.0%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6435.4
Applied rewrites35.4%
Taylor expanded in y around inf
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6446.6
Applied rewrites46.6%
if -2e13 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 0.5Initial program 92.5%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6493.5
Applied rewrites93.5%
Taylor expanded in z around 0
lower--.f64N/A
mul-1-negN/A
lower-neg.f6493.5
Applied rewrites93.5%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-inN/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6487.1
Applied rewrites87.1%
Final simplification55.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_1 -4e+278)
(/ x (fma t y 1.0))
(if (<= t_1 -2000.0) (- (* x (* a b))) (* x (- 1.0 (* y t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_1 <= -4e+278) {
tmp = x / fma(t, y, 1.0);
} else if (t_1 <= -2000.0) {
tmp = -(x * (a * b));
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_1 <= -4e+278) tmp = Float64(x / fma(t, y, 1.0)); elseif (t_1 <= -2000.0) tmp = Float64(-Float64(x * Float64(a * b))); else tmp = Float64(x * Float64(1.0 - Float64(y * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+278], N[(x / N[(t * y + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2000.0], (-N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+278}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(t, y, 1\right)}\\
\mathbf{elif}\;t\_1 \leq -2000:\\
\;\;\;\;-x \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -3.99999999999999985e278Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6463.4
Applied rewrites63.4%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6454.8
Applied rewrites54.8%
if -3.99999999999999985e278 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e3Initial program 93.7%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6448.2
Applied rewrites48.2%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f642.9
Applied rewrites2.9%
Taylor expanded in a around inf
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6417.4
Applied rewrites17.4%
if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 96.1%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6466.4
Applied rewrites66.4%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6447.3
Applied rewrites47.3%
Final simplification43.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (* x (* a b))))
(t_2 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_2 -2000.0) t_1 (if (<= t_2 5e+74) x t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -(x * (a * b));
double t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_2 <= -2000.0) {
tmp = t_1;
} else if (t_2 <= 5e+74) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -(x * (a * b))
t_2 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
if (t_2 <= (-2000.0d0)) then
tmp = t_1
else if (t_2 <= 5d+74) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -(x * (a * b));
double t_2 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
double tmp;
if (t_2 <= -2000.0) {
tmp = t_1;
} else if (t_2 <= 5e+74) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -(x * (a * b)) t_2 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b)) tmp = 0 if t_2 <= -2000.0: tmp = t_1 elif t_2 <= 5e+74: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(-Float64(x * Float64(a * b))) t_2 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_2 <= -2000.0) tmp = t_1; elseif (t_2 <= 5e+74) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -(x * (a * b)); t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b)); tmp = 0.0; if (t_2 <= -2000.0) tmp = t_1; elseif (t_2 <= 5e+74) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = (-N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$2 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2000.0], t$95$1, If[LessEqual[t$95$2, 5e+74], x, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -x \cdot \left(a \cdot b\right)\\
t_2 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_2 \leq -2000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+74}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e3 or 4.99999999999999963e74 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.9%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6454.7
Applied rewrites54.7%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6413.5
Applied rewrites13.5%
Taylor expanded in a around inf
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6425.1
Applied rewrites25.1%
if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.99999999999999963e74Initial program 92.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6487.5
Applied rewrites87.5%
Taylor expanded in y around 0
Applied rewrites60.4%
*-rgt-identity60.4
Applied rewrites60.4%
Final simplification34.5%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) -2000.0) (- (* x (* a b))) (* x (- 1.0 (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= -2000.0) {
tmp = -(x * (a * b));
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))) <= (-2000.0d0)) then
tmp = -(x * (a * b))
else
tmp = x * (1.0d0 - (a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))) <= -2000.0) {
tmp = -(x * (a * b));
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))) <= -2000.0: tmp = -(x * (a * b)) else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) <= -2000.0) tmp = Float64(-Float64(x * Float64(a * b))); else tmp = Float64(x * Float64(1.0 - Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= -2000.0) tmp = -(x * (a * b)); else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2000.0], (-N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2000:\\
\;\;\;\;-x \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e3Initial program 96.7%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6453.1
Applied rewrites53.1%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f642.8
Applied rewrites2.8%
Taylor expanded in a around inf
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6416.5
Applied rewrites16.5%
if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 96.1%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
Taylor expanded in a around 0
neg-mul-1N/A
unsub-negN/A
lower--.f64N/A
lower-*.f6444.5
Applied rewrites44.5%
Final simplification34.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* a (- (- z) b))))))
(if (<= a -2e-38)
t_1
(if (<= a 1.06e+142) (* x (exp (* y (- (log z) t)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((a * (-z - b)));
double tmp;
if (a <= -2e-38) {
tmp = t_1;
} else if (a <= 1.06e+142) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = x * exp((a * (-z - b)))
if (a <= (-2d-38)) then
tmp = t_1
else if (a <= 1.06d+142) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp((a * (-z - b)));
double tmp;
if (a <= -2e-38) {
tmp = t_1;
} else if (a <= 1.06e+142) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((a * (-z - b))) tmp = 0 if a <= -2e-38: tmp = t_1 elif a <= 1.06e+142: tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))) tmp = 0.0 if (a <= -2e-38) tmp = t_1; elseif (a <= 1.06e+142) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((a * (-z - b))); tmp = 0.0; if (a <= -2e-38) tmp = t_1; elseif (a <= 1.06e+142) tmp = x * exp((y * (log(z) - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2e-38], t$95$1, If[LessEqual[a, 1.06e+142], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{if}\;a \leq -2 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.06 \cdot 10^{+142}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.9999999999999999e-38 or 1.06e142 < a Initial program 92.9%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6488.9
Applied rewrites88.9%
Taylor expanded in z around 0
lower--.f64N/A
mul-1-negN/A
lower-neg.f6488.9
Applied rewrites88.9%
if -1.9999999999999999e-38 < a < 1.06e142Initial program 98.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6489.6
Applied rewrites89.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (exp (* a (- (- z) b)))))) (if (<= a -7.8e-47) t_1 (if (<= a 900000.0) (/ x (exp (* y t))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((a * (-z - b)));
double tmp;
if (a <= -7.8e-47) {
tmp = t_1;
} else if (a <= 900000.0) {
tmp = x / exp((y * t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = x * exp((a * (-z - b)))
if (a <= (-7.8d-47)) then
tmp = t_1
else if (a <= 900000.0d0) then
tmp = x / exp((y * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp((a * (-z - b)));
double tmp;
if (a <= -7.8e-47) {
tmp = t_1;
} else if (a <= 900000.0) {
tmp = x / Math.exp((y * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((a * (-z - b))) tmp = 0 if a <= -7.8e-47: tmp = t_1 elif a <= 900000.0: tmp = x / math.exp((y * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))) tmp = 0.0 if (a <= -7.8e-47) tmp = t_1; elseif (a <= 900000.0) tmp = Float64(x / exp(Float64(y * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((a * (-z - b))); tmp = 0.0; if (a <= -7.8e-47) tmp = t_1; elseif (a <= 900000.0) tmp = x / exp((y * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.8e-47], t$95$1, If[LessEqual[a, 900000.0], N[(x / N[Exp[N[(y * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{if}\;a \leq -7.8 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 900000:\\
\;\;\;\;\frac{x}{e^{y \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.79999999999999956e-47 or 9e5 < a Initial program 93.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6481.6
Applied rewrites81.6%
Taylor expanded in z around 0
lower--.f64N/A
mul-1-negN/A
lower-neg.f6481.6
Applied rewrites81.6%
if -7.79999999999999956e-47 < a < 9e5Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6481.1
Applied rewrites81.1%
distribute-rgt-neg-outN/A
exp-negN/A
pow-expN/A
un-div-invN/A
lower-/.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f6481.1
Applied rewrites81.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (exp (* a (- (- z) b)))))) (if (<= a -7.8e-47) t_1 (if (<= a 900000.0) (* x (exp (- (* y t)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((a * (-z - b)));
double tmp;
if (a <= -7.8e-47) {
tmp = t_1;
} else if (a <= 900000.0) {
tmp = x * exp(-(y * t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = x * exp((a * (-z - b)))
if (a <= (-7.8d-47)) then
tmp = t_1
else if (a <= 900000.0d0) then
tmp = x * exp(-(y * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp((a * (-z - b)));
double tmp;
if (a <= -7.8e-47) {
tmp = t_1;
} else if (a <= 900000.0) {
tmp = x * Math.exp(-(y * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((a * (-z - b))) tmp = 0 if a <= -7.8e-47: tmp = t_1 elif a <= 900000.0: tmp = x * math.exp(-(y * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))) tmp = 0.0 if (a <= -7.8e-47) tmp = t_1; elseif (a <= 900000.0) tmp = Float64(x * exp(Float64(-Float64(y * t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((a * (-z - b))); tmp = 0.0; if (a <= -7.8e-47) tmp = t_1; elseif (a <= 900000.0) tmp = x * exp(-(y * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.8e-47], t$95$1, If[LessEqual[a, 900000.0], N[(x * N[Exp[(-N[(y * t), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{if}\;a \leq -7.8 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 900000:\\
\;\;\;\;x \cdot e^{-y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.79999999999999956e-47 or 9e5 < a Initial program 93.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6481.6
Applied rewrites81.6%
Taylor expanded in z around 0
lower--.f64N/A
mul-1-negN/A
lower-neg.f6481.6
Applied rewrites81.6%
if -7.79999999999999956e-47 < a < 9e5Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6481.1
Applied rewrites81.1%
Final simplification81.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (- (* y t))))))
(if (<= t -1060000000.0)
t_1
(if (<= t 8e+39) (* x (exp (- (* a b)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp(-(y * t));
double tmp;
if (t <= -1060000000.0) {
tmp = t_1;
} else if (t <= 8e+39) {
tmp = x * exp(-(a * b));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = x * exp(-(y * t))
if (t <= (-1060000000.0d0)) then
tmp = t_1
else if (t <= 8d+39) then
tmp = x * exp(-(a * b))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp(-(y * t));
double tmp;
if (t <= -1060000000.0) {
tmp = t_1;
} else if (t <= 8e+39) {
tmp = x * Math.exp(-(a * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp(-(y * t)) tmp = 0 if t <= -1060000000.0: tmp = t_1 elif t <= 8e+39: tmp = x * math.exp(-(a * b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(-Float64(y * t)))) tmp = 0.0 if (t <= -1060000000.0) tmp = t_1; elseif (t <= 8e+39) tmp = Float64(x * exp(Float64(-Float64(a * b)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp(-(y * t)); tmp = 0.0; if (t <= -1060000000.0) tmp = t_1; elseif (t <= 8e+39) tmp = x * exp(-(a * b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[(-N[(y * t), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1060000000.0], t$95$1, If[LessEqual[t, 8e+39], N[(x * N[Exp[(-N[(a * b), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{-y \cdot t}\\
\mathbf{if}\;t \leq -1060000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+39}:\\
\;\;\;\;x \cdot e^{-a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.06e9 or 7.99999999999999952e39 < t Initial program 98.4%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6484.6
Applied rewrites84.6%
if -1.06e9 < t < 7.99999999999999952e39Initial program 94.2%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6469.5
Applied rewrites69.5%
Final simplification77.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.35e+68)
(* x (pow z y))
(if (<= y 1.4e+25)
(* x (exp (- (* a b))))
(* x (* 0.5 (* y (* y (* t t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.35e+68) {
tmp = x * pow(z, y);
} else if (y <= 1.4e+25) {
tmp = x * exp(-(a * b));
} else {
tmp = x * (0.5 * (y * (y * (t * t))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (y <= (-1.35d+68)) then
tmp = x * (z ** y)
else if (y <= 1.4d+25) then
tmp = x * exp(-(a * b))
else
tmp = x * (0.5d0 * (y * (y * (t * t))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.35e+68) {
tmp = x * Math.pow(z, y);
} else if (y <= 1.4e+25) {
tmp = x * Math.exp(-(a * b));
} else {
tmp = x * (0.5 * (y * (y * (t * t))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.35e+68: tmp = x * math.pow(z, y) elif y <= 1.4e+25: tmp = x * math.exp(-(a * b)) else: tmp = x * (0.5 * (y * (y * (t * t)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.35e+68) tmp = Float64(x * (z ^ y)); elseif (y <= 1.4e+25) tmp = Float64(x * exp(Float64(-Float64(a * b)))); else tmp = Float64(x * Float64(0.5 * Float64(y * Float64(y * Float64(t * t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.35e+68) tmp = x * (z ^ y); elseif (y <= 1.4e+25) tmp = x * exp(-(a * b)); else tmp = x * (0.5 * (y * (y * (t * t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.35e+68], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+25], N[(x * N[Exp[(-N[(a * b), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(x * N[(0.5 * N[(y * N[(y * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+68}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+25}:\\
\;\;\;\;x \cdot e^{-a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot \left(t \cdot t\right)\right)\right)\right)\\
\end{array}
\end{array}
if y < -1.34999999999999995e68Initial program 100.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6492.0
Applied rewrites92.0%
Taylor expanded in t around 0
lower-*.f64N/A
lower-pow.f6473.9
Applied rewrites73.9%
if -1.34999999999999995e68 < y < 1.4000000000000001e25Initial program 94.9%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6475.7
Applied rewrites75.7%
if 1.4000000000000001e25 < y Initial program 96.7%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6471.3
Applied rewrites71.3%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6444.1
Applied rewrites44.1%
Taylor expanded in y around inf
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6461.5
Applied rewrites61.5%
Final simplification72.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (- 1.0 (* a b))))) (if (<= b -1.95e+99) t_1 (if (<= b 8.5e+85) (* x (- 1.0 (* y t))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (1.0 - (a * b));
double tmp;
if (b <= -1.95e+99) {
tmp = t_1;
} else if (b <= 8.5e+85) {
tmp = x * (1.0 - (y * t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - (a * b))
if (b <= (-1.95d+99)) then
tmp = t_1
else if (b <= 8.5d+85) then
tmp = x * (1.0d0 - (y * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (1.0 - (a * b));
double tmp;
if (b <= -1.95e+99) {
tmp = t_1;
} else if (b <= 8.5e+85) {
tmp = x * (1.0 - (y * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (1.0 - (a * b)) tmp = 0 if b <= -1.95e+99: tmp = t_1 elif b <= 8.5e+85: tmp = x * (1.0 - (y * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(1.0 - Float64(a * b))) tmp = 0.0 if (b <= -1.95e+99) tmp = t_1; elseif (b <= 8.5e+85) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (1.0 - (a * b)); tmp = 0.0; if (b <= -1.95e+99) tmp = t_1; elseif (b <= 8.5e+85) tmp = x * (1.0 - (y * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.95e+99], t$95$1, If[LessEqual[b, 8.5e+85], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - a \cdot b\right)\\
\mathbf{if}\;b \leq -1.95 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{+85}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.94999999999999997e99 or 8.4999999999999994e85 < b Initial program 98.8%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6481.9
Applied rewrites81.9%
Taylor expanded in a around 0
neg-mul-1N/A
unsub-negN/A
lower--.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -1.94999999999999997e99 < b < 8.4999999999999994e85Initial program 95.1%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6471.2
Applied rewrites71.2%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
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
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6473.2
Applied rewrites73.2%
Taylor expanded in y around 0
Applied rewrites18.7%
*-rgt-identity18.7
Applied rewrites18.7%
herbie shell --seed 2024219
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
:precision binary64
(* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))