
(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 14 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 (* (- x) (fma a b (fma z (fma 0.5 (* z a) a) -1.0))))
(t_2 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_2 -2000.0)
(* -0.5 (* a (* x (* z z))))
(if (<= t_2 5.0)
t_1
(if (<= t_2 5e+295) (* a (fma x (- (- z) b) (/ x a))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -x * fma(a, b, fma(z, fma(0.5, (z * a), a), -1.0));
double t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_2 <= -2000.0) {
tmp = -0.5 * (a * (x * (z * z)));
} else if (t_2 <= 5.0) {
tmp = t_1;
} else if (t_2 <= 5e+295) {
tmp = a * fma(x, (-z - b), (x / a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-x) * fma(a, b, fma(z, fma(0.5, Float64(z * a), a), -1.0))) 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 = Float64(-0.5 * Float64(a * Float64(x * Float64(z * z)))); elseif (t_2 <= 5.0) tmp = t_1; elseif (t_2 <= 5e+295) tmp = Float64(a * fma(x, Float64(Float64(-z) - b), Float64(x / a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-x) * N[(a * b + N[(z * N[(0.5 * N[(z * a), $MachinePrecision] + a), $MachinePrecision] + -1.0), $MachinePrecision]), $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], N[(-0.5 * N[(a * N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5.0], t$95$1, If[LessEqual[t$95$2, 5e+295], N[(a * N[(x * N[((-z) - b), $MachinePrecision] + N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-x\right) \cdot \mathsf{fma}\left(a, b, \mathsf{fma}\left(z, \mathsf{fma}\left(0.5, z \cdot a, a\right), -1\right)\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:\\
\;\;\;\;-0.5 \cdot \left(a \cdot \left(x \cdot \left(z \cdot z\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+295}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(x, \left(-z\right) - b, \frac{x}{a}\right)\\
\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))) < -2e3Initial program 96.7%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites53.5%
Taylor expanded in y around 0
Applied rewrites2.9%
Taylor expanded in z around 0
Applied rewrites3.8%
Taylor expanded in z around inf
Applied rewrites56.1%
if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 5 or 4.99999999999999991e295 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 95.1%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites82.9%
Taylor expanded in y around 0
Applied rewrites61.2%
Taylor expanded in z around 0
Applied rewrites57.9%
Taylor expanded in x around -inf
Applied rewrites72.5%
if 5 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.99999999999999991e295Initial program 97.4%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites70.0%
Taylor expanded in y around 0
Applied rewrites10.9%
Taylor expanded in a around inf
Applied rewrites22.4%
Taylor expanded in z around 0
Applied rewrites22.4%
Final simplification52.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 -2000.0)
(* -0.5 (* a (* x (* z z))))
(if (<= t_1 1e-23)
(+ x (fma z (* x (- a)) (* a (* x (- b)))))
(if (<= t_1 1e+305)
(* a (fma x (- (- z) b) (/ x a)))
(- (* x (* a b))))))))
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 <= -2000.0) {
tmp = -0.5 * (a * (x * (z * z)));
} else if (t_1 <= 1e-23) {
tmp = x + fma(z, (x * -a), (a * (x * -b)));
} else if (t_1 <= 1e+305) {
tmp = a * fma(x, (-z - b), (x / a));
} else {
tmp = -(x * (a * b));
}
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 <= -2000.0) tmp = Float64(-0.5 * Float64(a * Float64(x * Float64(z * z)))); elseif (t_1 <= 1e-23) tmp = Float64(x + fma(z, Float64(x * Float64(-a)), Float64(a * Float64(x * Float64(-b))))); elseif (t_1 <= 1e+305) tmp = Float64(a * fma(x, Float64(Float64(-z) - b), Float64(x / a))); else tmp = Float64(-Float64(x * Float64(a * b))); 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, -2000.0], N[(-0.5 * N[(a * N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-23], N[(x + N[(z * N[(x * (-a)), $MachinePrecision] + N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+305], N[(a * N[(x * N[((-z) - b), $MachinePrecision] + N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(x * N[(a * b), $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 -2000:\\
\;\;\;\;-0.5 \cdot \left(a \cdot \left(x \cdot \left(z \cdot z\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-23}:\\
\;\;\;\;x + \mathsf{fma}\left(z, x \cdot \left(-a\right), a \cdot \left(x \cdot \left(-b\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+305}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(x, \left(-z\right) - b, \frac{x}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-x \cdot \left(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 a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites53.5%
Taylor expanded in y around 0
Applied rewrites2.9%
Taylor expanded in z around 0
Applied rewrites3.8%
Taylor expanded in z around inf
Applied rewrites56.1%
if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999996e-24Initial program 91.8%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites92.9%
Taylor expanded in y around 0
Applied rewrites91.0%
Taylor expanded in z around 0
Applied rewrites91.1%
Taylor expanded in z around 0
Applied rewrites91.1%
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.9999999999999994e304Initial program 97.6%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites71.1%
Taylor expanded in y around 0
Applied rewrites12.4%
Taylor expanded in a around inf
Applied rewrites23.1%
Taylor expanded in z around 0
Applied rewrites23.1%
if 9.9999999999999994e304 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.7%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites72.8%
Taylor expanded in y around 0
Applied rewrites35.5%
Taylor expanded in b around inf
Applied rewrites34.9%
Applied rewrites58.8%
Final simplification52.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 -2000.0)
(* -0.5 (* a (* x (* z z))))
(if (<= t_1 1e-23)
(fma a (- (fma x b (* x z))) x)
(if (<= t_1 1e+305)
(* a (fma x (- (- z) b) (/ x a)))
(- (* x (* a b))))))))
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 <= -2000.0) {
tmp = -0.5 * (a * (x * (z * z)));
} else if (t_1 <= 1e-23) {
tmp = fma(a, -fma(x, b, (x * z)), x);
} else if (t_1 <= 1e+305) {
tmp = a * fma(x, (-z - b), (x / a));
} else {
tmp = -(x * (a * b));
}
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 <= -2000.0) tmp = Float64(-0.5 * Float64(a * Float64(x * Float64(z * z)))); elseif (t_1 <= 1e-23) tmp = fma(a, Float64(-fma(x, b, Float64(x * z))), x); elseif (t_1 <= 1e+305) tmp = Float64(a * fma(x, Float64(Float64(-z) - b), Float64(x / a))); else tmp = Float64(-Float64(x * Float64(a * b))); 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, -2000.0], N[(-0.5 * N[(a * N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-23], N[(a * (-N[(x * b + N[(x * z), $MachinePrecision]), $MachinePrecision]) + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+305], N[(a * N[(x * N[((-z) - b), $MachinePrecision] + N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(x * N[(a * b), $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 -2000:\\
\;\;\;\;-0.5 \cdot \left(a \cdot \left(x \cdot \left(z \cdot z\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left(a, -\mathsf{fma}\left(x, b, x \cdot z\right), x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+305}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(x, \left(-z\right) - b, \frac{x}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-x \cdot \left(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 a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites53.5%
Taylor expanded in y around 0
Applied rewrites2.9%
Taylor expanded in z around 0
Applied rewrites3.8%
Taylor expanded in z around inf
Applied rewrites56.1%
if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999996e-24Initial program 91.8%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites92.9%
Taylor expanded in y around 0
Applied rewrites91.0%
Taylor expanded in z around 0
Applied rewrites91.0%
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.9999999999999994e304Initial program 97.6%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites71.1%
Taylor expanded in y around 0
Applied rewrites12.4%
Taylor expanded in a around inf
Applied rewrites23.1%
Taylor expanded in z around 0
Applied rewrites23.1%
if 9.9999999999999994e304 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.7%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites72.8%
Taylor expanded in y around 0
Applied rewrites35.5%
Taylor expanded in b around inf
Applied rewrites34.9%
Applied rewrites58.8%
Final simplification52.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 -2000.0)
(* -0.5 (* a (* x (* z z))))
(if (<= t_1 1e+305) (fma a (- (fma x b (* x z))) x) (- (* x (* a b)))))))
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 <= -2000.0) {
tmp = -0.5 * (a * (x * (z * z)));
} else if (t_1 <= 1e+305) {
tmp = fma(a, -fma(x, b, (x * z)), x);
} else {
tmp = -(x * (a * b));
}
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 <= -2000.0) tmp = Float64(-0.5 * Float64(a * Float64(x * Float64(z * z)))); elseif (t_1 <= 1e+305) tmp = fma(a, Float64(-fma(x, b, Float64(x * z))), x); else tmp = Float64(-Float64(x * Float64(a * b))); 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, -2000.0], N[(-0.5 * N[(a * N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+305], N[(a * (-N[(x * b + N[(x * z), $MachinePrecision]), $MachinePrecision]) + x), $MachinePrecision], (-N[(x * N[(a * b), $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 -2000:\\
\;\;\;\;-0.5 \cdot \left(a \cdot \left(x \cdot \left(z \cdot z\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(a, -\mathsf{fma}\left(x, b, x \cdot z\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;-x \cdot \left(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 a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites53.5%
Taylor expanded in y around 0
Applied rewrites2.9%
Taylor expanded in z around 0
Applied rewrites3.8%
Taylor expanded in z around inf
Applied rewrites56.1%
if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999994e304Initial program 95.6%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites78.6%
Taylor expanded in y around 0
Applied rewrites39.7%
Taylor expanded in z around 0
Applied rewrites39.7%
if 9.9999999999999994e304 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.7%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites72.8%
Taylor expanded in y around 0
Applied rewrites35.5%
Taylor expanded in b around inf
Applied rewrites34.9%
Applied rewrites58.8%
Final simplification48.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 -2000.0)
(* a (* x (- b)))
(if (<= t_1 1e+305) (fma a (- (fma x b (* x z))) x) (- (* x (* a b)))))))
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 <= -2000.0) {
tmp = a * (x * -b);
} else if (t_1 <= 1e+305) {
tmp = fma(a, -fma(x, b, (x * z)), x);
} else {
tmp = -(x * (a * b));
}
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 <= -2000.0) tmp = Float64(a * Float64(x * Float64(-b))); elseif (t_1 <= 1e+305) tmp = fma(a, Float64(-fma(x, b, Float64(x * z))), x); else tmp = Float64(-Float64(x * Float64(a * b))); 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, -2000.0], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+305], N[(a * (-N[(x * b + N[(x * z), $MachinePrecision]), $MachinePrecision]) + x), $MachinePrecision], (-N[(x * N[(a * b), $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 -2000:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(a, -\mathsf{fma}\left(x, b, x \cdot z\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;-x \cdot \left(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 a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites53.5%
Taylor expanded in y around 0
Applied rewrites2.9%
Taylor expanded in b around inf
Applied rewrites18.2%
if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999994e304Initial program 95.6%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites78.6%
Taylor expanded in y around 0
Applied rewrites39.7%
Taylor expanded in z around 0
Applied rewrites39.7%
if 9.9999999999999994e304 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.7%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites72.8%
Taylor expanded in y around 0
Applied rewrites35.5%
Taylor expanded in b around inf
Applied rewrites34.9%
Applied rewrites58.8%
Final simplification35.4%
(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 -2000.0)
(* a (* x (- b)))
(if (<= t_1 5e+74) (fma a (- (* x z)) x) (- (* x (* a b)))))))
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 <= -2000.0) {
tmp = a * (x * -b);
} else if (t_1 <= 5e+74) {
tmp = fma(a, -(x * z), x);
} else {
tmp = -(x * (a * b));
}
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 <= -2000.0) tmp = Float64(a * Float64(x * Float64(-b))); elseif (t_1 <= 5e+74) tmp = fma(a, Float64(-Float64(x * z)), x); else tmp = Float64(-Float64(x * Float64(a * b))); 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, -2000.0], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+74], N[(a * (-N[(x * z), $MachinePrecision]) + x), $MachinePrecision], (-N[(x * N[(a * b), $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 -2000:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(a, -x \cdot z, x\right)\\
\mathbf{else}:\\
\;\;\;\;-x \cdot \left(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 a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites53.5%
Taylor expanded in y around 0
Applied rewrites2.9%
Taylor expanded in b around inf
Applied rewrites18.2%
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 a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites86.9%
Taylor expanded in y around 0
Applied rewrites61.1%
Taylor expanded in z around 0
Applied rewrites61.1%
Taylor expanded in b around 0
Applied rewrites61.3%
if 4.99999999999999963e74 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 99.0%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites70.4%
Taylor expanded in y around 0
Applied rewrites23.1%
Taylor expanded in b around inf
Applied rewrites22.4%
Applied rewrites32.8%
Final simplification35.3%
(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
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 (/ 1.0 (/ -1.0 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 * (1.0 / (-1.0 / 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 * (1.0d0 / ((-1.0d0) / 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 * (1.0 / (-1.0 / 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 * (1.0 / (-1.0 / 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 * Float64(1.0 / Float64(-1.0 / 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 * (1.0 / (-1.0 / 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 * N[(1.0 / N[(-1.0 / t), $MachinePrecision]), $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 -7.8 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 900000:\\
\;\;\;\;x \cdot e^{y \cdot \frac{1}{\frac{-1}{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
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%
Applied rewrites77.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
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(a * Float64(-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 \left(-b\right)}\\
\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 (* x (exp (* a (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp((a * -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((a * -b))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp((a * -b));
}
def code(x, y, z, t, a, b): return x * math.exp((a * -b))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(a * Float64(-b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp((a * -b)); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{a \cdot \left(-b\right)}
\end{array}
Initial program 96.3%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6458.2
Applied rewrites58.2%
Final simplification58.2%
(FPCore (x y z t a b) :precision binary64 (- (* x (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
return -(x * (a * 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 * (a * b))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return -(x * (a * b));
}
def code(x, y, z, t, a, b): return -(x * (a * b))
function code(x, y, z, t, a, b) return Float64(-Float64(x * Float64(a * b))) end
function tmp = code(x, y, z, t, a, b) tmp = -(x * (a * b)); end
code[x_, y_, z_, t_, a_, b_] := (-N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision])
\begin{array}{l}
\\
-x \cdot \left(a \cdot b\right)
\end{array}
Initial program 96.3%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites68.9%
Taylor expanded in y around 0
Applied rewrites26.2%
Taylor expanded in b around inf
Applied rewrites16.3%
Applied rewrites19.4%
Final simplification19.4%
(FPCore (x y z t a b) :precision binary64 (* a (* x (- b))))
double code(double x, double y, double z, double t, double a, double b) {
return a * (x * -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 = a * (x * -b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a * (x * -b);
}
def code(x, y, z, t, a, b): return a * (x * -b)
function code(x, y, z, t, a, b) return Float64(a * Float64(x * Float64(-b))) end
function tmp = code(x, y, z, t, a, b) tmp = a * (x * -b); end
code[x_, y_, z_, t_, a_, b_] := N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \left(x \cdot \left(-b\right)\right)
\end{array}
Initial program 96.3%
Taylor expanded in a around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
Applied rewrites68.9%
Taylor expanded in y around 0
Applied rewrites26.2%
Taylor expanded in b around inf
Applied rewrites16.3%
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))))))