
(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 15 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 97.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 -200000.0)
(* (* a -0.5) (* x (* z z)))
(if (<= t_1 1e-12)
(* x (exp (* z (- a))))
(+
(* z (fma a (- x) (/ (fma (* a b) (- x) x) z)))
(* z (* -0.5 (* z (* x a)))))))))
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 <= -200000.0) {
tmp = (a * -0.5) * (x * (z * z));
} else if (t_1 <= 1e-12) {
tmp = x * exp((z * -a));
} else {
tmp = (z * fma(a, -x, (fma((a * b), -x, x) / z))) + (z * (-0.5 * (z * (x * a))));
}
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 <= -200000.0) tmp = Float64(Float64(a * -0.5) * Float64(x * Float64(z * z))); elseif (t_1 <= 1e-12) tmp = Float64(x * exp(Float64(z * Float64(-a)))); else tmp = Float64(Float64(z * fma(a, Float64(-x), Float64(fma(Float64(a * b), Float64(-x), x) / z))) + Float64(z * Float64(-0.5 * Float64(z * Float64(x * a))))); 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, -200000.0], N[(N[(a * -0.5), $MachinePrecision] * N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-12], N[(x * N[Exp[N[(z * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(a * (-x) + N[(N[(N[(a * b), $MachinePrecision] * (-x) + x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z * N[(-0.5 * N[(z * N[(x * a), $MachinePrecision]), $MachinePrecision]), $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 -200000:\\
\;\;\;\;\left(a \cdot -0.5\right) \cdot \left(x \cdot \left(z \cdot z\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-12}:\\
\;\;\;\;x \cdot e^{z \cdot \left(-a\right)}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(a, -x, \frac{\mathsf{fma}\left(a \cdot b, -x, x\right)}{z}\right) + z \cdot \left(-0.5 \cdot \left(z \cdot \left(x \cdot a\right)\right)\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))) < -2e5Initial program 98.2%
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 rewrites58.6%
Taylor expanded in y around 0
Applied rewrites3.8%
Taylor expanded in z around 0
Applied rewrites3.7%
Taylor expanded in z around inf
Applied rewrites65.1%
if -2e5 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999998e-13Initial program 94.1%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6498.7
Applied rewrites98.7%
Taylor expanded in z around 0
Applied rewrites98.7%
Taylor expanded in b around 0
Applied rewrites96.7%
if 9.9999999999999998e-13 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 98.2%
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.4%
Taylor expanded in y around 0
Applied rewrites24.1%
Taylor expanded in z around 0
Applied rewrites19.4%
Taylor expanded in z around inf
Applied rewrites39.9%
Final simplification58.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 -200000.0)
(* (* a -0.5) (* x (* z z)))
(if (<= t_1 1e-12)
(fma x (fma -0.5 (* a (* z z)) (* a (- (- b) z))) x)
(+
(* z (fma a (- x) (/ (fma (* a b) (- x) x) z)))
(* z (* -0.5 (* z (* x a)))))))))
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 <= -200000.0) {
tmp = (a * -0.5) * (x * (z * z));
} else if (t_1 <= 1e-12) {
tmp = fma(x, fma(-0.5, (a * (z * z)), (a * (-b - z))), x);
} else {
tmp = (z * fma(a, -x, (fma((a * b), -x, x) / z))) + (z * (-0.5 * (z * (x * a))));
}
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 <= -200000.0) tmp = Float64(Float64(a * -0.5) * Float64(x * Float64(z * z))); elseif (t_1 <= 1e-12) tmp = fma(x, fma(-0.5, Float64(a * Float64(z * z)), Float64(a * Float64(Float64(-b) - z))), x); else tmp = Float64(Float64(z * fma(a, Float64(-x), Float64(fma(Float64(a * b), Float64(-x), x) / z))) + Float64(z * Float64(-0.5 * Float64(z * Float64(x * a))))); 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, -200000.0], N[(N[(a * -0.5), $MachinePrecision] * N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-12], N[(x * N[(-0.5 * N[(a * N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(z * N[(a * (-x) + N[(N[(N[(a * b), $MachinePrecision] * (-x) + x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z * N[(-0.5 * N[(z * N[(x * a), $MachinePrecision]), $MachinePrecision]), $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 -200000:\\
\;\;\;\;\left(a \cdot -0.5\right) \cdot \left(x \cdot \left(z \cdot z\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-0.5, a \cdot \left(z \cdot z\right), a \cdot \left(\left(-b\right) - z\right)\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(a, -x, \frac{\mathsf{fma}\left(a \cdot b, -x, x\right)}{z}\right) + z \cdot \left(-0.5 \cdot \left(z \cdot \left(x \cdot a\right)\right)\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))) < -2e5Initial program 98.2%
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 rewrites58.6%
Taylor expanded in y around 0
Applied rewrites3.8%
Taylor expanded in z around 0
Applied rewrites3.7%
Taylor expanded in z around inf
Applied rewrites65.1%
if -2e5 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999998e-13Initial program 94.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 rewrites91.5%
Taylor expanded in y around 0
Applied rewrites86.9%
Taylor expanded in z around 0
Applied rewrites84.3%
Taylor expanded in x around 0
Applied rewrites92.8%
if 9.9999999999999998e-13 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 98.2%
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.4%
Taylor expanded in y around 0
Applied rewrites24.1%
Taylor expanded in z around 0
Applied rewrites19.4%
Taylor expanded in z around inf
Applied rewrites39.9%
Final simplification58.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 -4e+242)
(* a (/ x a))
(if (<= t_1 -1e+14) (* (- b) (* x a)) (- 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 <= -4e+242) {
tmp = a * (x / a);
} else if (t_1 <= -1e+14) {
tmp = -b * (x * a);
} else {
tmp = x - (x * (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) :: t_1
real(8) :: tmp
t_1 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
if (t_1 <= (-4d+242)) then
tmp = a * (x / a)
else if (t_1 <= (-1d+14)) then
tmp = -b * (x * a)
else
tmp = x - (x * (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 t_1 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
double tmp;
if (t_1 <= -4e+242) {
tmp = a * (x / a);
} else if (t_1 <= -1e+14) {
tmp = -b * (x * a);
} else {
tmp = x - (x * (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b)) tmp = 0 if t_1 <= -4e+242: tmp = a * (x / a) elif t_1 <= -1e+14: tmp = -b * (x * a) else: tmp = x - (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 <= -4e+242) tmp = Float64(a * Float64(x / a)); elseif (t_1 <= -1e+14) tmp = Float64(Float64(-b) * Float64(x * a)); else tmp = Float64(x - Float64(x * Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b)); tmp = 0.0; if (t_1 <= -4e+242) tmp = a * (x / a); elseif (t_1 <= -1e+14) tmp = -b * (x * a); else tmp = x - (x * (a * b)); end tmp_2 = 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+242], N[(a * N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e+14], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(a * b), $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^{+242}:\\
\;\;\;\;a \cdot \frac{x}{a}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+14}:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x - 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))) < -4.0000000000000002e242Initial program 100.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 rewrites53.6%
Taylor expanded in y around 0
Applied rewrites2.5%
Taylor expanded in a around inf
Applied rewrites6.3%
Taylor expanded in a around 0
Applied rewrites22.9%
if -4.0000000000000002e242 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -1e14Initial program 96.5%
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 rewrites65.0%
Taylor expanded in y around 0
Applied rewrites5.0%
Taylor expanded in b around inf
Applied rewrites20.4%
Applied rewrites22.1%
if -1e14 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.2%
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 rewrites73.3%
Taylor expanded in y around 0
Applied rewrites39.6%
Taylor expanded in z around 0
Applied rewrites43.5%
Final simplification34.9%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) -1e+14) (* (* a -0.5) (* x (* z z))) (* x (exp (* 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))) <= -1e+14) {
tmp = (a * -0.5) * (x * (z * z));
} else {
tmp = x * exp((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))) <= (-1d+14)) then
tmp = (a * (-0.5d0)) * (x * (z * z))
else
tmp = x * exp((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))) <= -1e+14) {
tmp = (a * -0.5) * (x * (z * z));
} else {
tmp = x * Math.exp((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))) <= -1e+14: tmp = (a * -0.5) * (x * (z * z)) else: tmp = x * math.exp((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))) <= -1e+14) tmp = Float64(Float64(a * -0.5) * Float64(x * Float64(z * z))); else tmp = Float64(x * exp(Float64(a * Float64(-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))) <= -1e+14) tmp = (a * -0.5) * (x * (z * z)); else tmp = x * exp((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], -1e+14], N[(N[(a * -0.5), $MachinePrecision] * N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[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 -1 \cdot 10^{+14}:\\
\;\;\;\;\left(a \cdot -0.5\right) \cdot \left(x \cdot \left(z \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-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))) < -1e14Initial program 98.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 rewrites59.7%
Taylor expanded in y around 0
Applied rewrites3.9%
Taylor expanded in z around 0
Applied rewrites3.8%
Taylor expanded in z around inf
Applied rewrites65.3%
if -1e14 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.2%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Final simplification64.2%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) -200000.0) (* (* a -0.5) (* x (* z z))) (fma x (fma -0.5 (* a (* z z)) (* a (- (- b) z))) x)))
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))) <= -200000.0) {
tmp = (a * -0.5) * (x * (z * z));
} else {
tmp = fma(x, fma(-0.5, (a * (z * z)), (a * (-b - z))), x);
}
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))) <= -200000.0) tmp = Float64(Float64(a * -0.5) * Float64(x * Float64(z * z))); else tmp = fma(x, fma(-0.5, Float64(a * Float64(z * z)), Float64(a * Float64(Float64(-b) - z))), x); end return 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], -200000.0], N[(N[(a * -0.5), $MachinePrecision] * N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-0.5 * N[(a * N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $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 -200000:\\
\;\;\;\;\left(a \cdot -0.5\right) \cdot \left(x \cdot \left(z \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-0.5, a \cdot \left(z \cdot z\right), a \cdot \left(\left(-b\right) - z\right)\right), x\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))) < -2e5Initial program 98.2%
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 rewrites58.6%
Taylor expanded in y around 0
Applied rewrites3.8%
Taylor expanded in z around 0
Applied rewrites3.7%
Taylor expanded in z around inf
Applied rewrites65.1%
if -2e5 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.2%
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 rewrites74.3%
Taylor expanded in y around 0
Applied rewrites40.1%
Taylor expanded in z around 0
Applied rewrites35.9%
Taylor expanded in x around 0
Applied rewrites45.5%
Final simplification53.7%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) -200000.0) (* (* a -0.5) (* x (* z z))) (- x (* x (* 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))) <= -200000.0) {
tmp = (a * -0.5) * (x * (z * z));
} else {
tmp = x - (x * (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))) <= (-200000.0d0)) then
tmp = (a * (-0.5d0)) * (x * (z * z))
else
tmp = x - (x * (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))) <= -200000.0) {
tmp = (a * -0.5) * (x * (z * z));
} else {
tmp = x - (x * (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))) <= -200000.0: tmp = (a * -0.5) * (x * (z * z)) else: tmp = x - (x * (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))) <= -200000.0) tmp = Float64(Float64(a * -0.5) * Float64(x * Float64(z * z))); else tmp = Float64(x - Float64(x * 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))) <= -200000.0) tmp = (a * -0.5) * (x * (z * z)); else tmp = x - (x * (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], -200000.0], N[(N[(a * -0.5), $MachinePrecision] * N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * 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 -200000:\\
\;\;\;\;\left(a \cdot -0.5\right) \cdot \left(x \cdot \left(z \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - 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))) < -2e5Initial program 98.2%
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 rewrites58.6%
Taylor expanded in y around 0
Applied rewrites3.8%
Taylor expanded in z around 0
Applied rewrites3.7%
Taylor expanded in z around inf
Applied rewrites65.1%
if -2e5 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.2%
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 rewrites74.3%
Taylor expanded in y around 0
Applied rewrites40.1%
Taylor expanded in z around 0
Applied rewrites44.0%
Final simplification52.8%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) -1e+14) (* (- b) (* x a)) (- x (* x (* 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))) <= -1e+14) {
tmp = -b * (x * a);
} else {
tmp = x - (x * (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))) <= (-1d+14)) then
tmp = -b * (x * a)
else
tmp = x - (x * (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))) <= -1e+14) {
tmp = -b * (x * a);
} else {
tmp = x - (x * (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))) <= -1e+14: tmp = -b * (x * a) else: tmp = x - (x * (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))) <= -1e+14) tmp = Float64(Float64(-b) * Float64(x * a)); else tmp = Float64(x - Float64(x * 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))) <= -1e+14) tmp = -b * (x * a); else tmp = x - (x * (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], -1e+14], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * 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 -1 \cdot 10^{+14}:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x - 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))) < -1e14Initial program 98.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 rewrites59.7%
Taylor expanded in y around 0
Applied rewrites3.9%
Taylor expanded in b around inf
Applied rewrites17.6%
Applied rewrites17.6%
if -1e14 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 97.2%
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 rewrites73.3%
Taylor expanded in y around 0
Applied rewrites39.6%
Taylor expanded in z around 0
Applied rewrites43.5%
Final simplification32.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (- (log z) t))))))
(if (<= y -5.6e-90)
t_1
(if (<= y 1e-22) (* x (exp (* a (- (- b) z)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((y * (log(z) - t)));
double tmp;
if (y <= -5.6e-90) {
tmp = t_1;
} else if (y <= 1e-22) {
tmp = x * exp((a * (-b - z)));
} 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 * (log(z) - t)))
if (y <= (-5.6d-90)) then
tmp = t_1
else if (y <= 1d-22) then
tmp = x * exp((a * (-b - z)))
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 * (Math.log(z) - t)));
double tmp;
if (y <= -5.6e-90) {
tmp = t_1;
} else if (y <= 1e-22) {
tmp = x * Math.exp((a * (-b - z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((y * (math.log(z) - t))) tmp = 0 if y <= -5.6e-90: tmp = t_1 elif y <= 1e-22: tmp = x * math.exp((a * (-b - z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(y * Float64(log(z) - t)))) tmp = 0.0 if (y <= -5.6e-90) tmp = t_1; elseif (y <= 1e-22) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((y * (log(z) - t))); tmp = 0.0; if (y <= -5.6e-90) tmp = t_1; elseif (y <= 1e-22) tmp = x * exp((a * (-b - z))); 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 * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.6e-90], t$95$1, If[LessEqual[y, 1e-22], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{if}\;y \leq -5.6 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 10^{-22}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.5999999999999998e-90 or 1e-22 < y Initial program 100.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6490.0
Applied rewrites90.0%
if -5.5999999999999998e-90 < y < 1e-22Initial program 94.3%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6487.0
Applied rewrites87.0%
Taylor expanded in z around 0
Applied rewrites87.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (log z))))))
(if (<= y -2.05e+76)
t_1
(if (<= y 102000000000.0) (* x (exp (* a (- (- b) z)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((y * log(z)));
double tmp;
if (y <= -2.05e+76) {
tmp = t_1;
} else if (y <= 102000000000.0) {
tmp = x * exp((a * (-b - z)));
} 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 * log(z)))
if (y <= (-2.05d+76)) then
tmp = t_1
else if (y <= 102000000000.0d0) then
tmp = x * exp((a * (-b - z)))
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 * Math.log(z)));
double tmp;
if (y <= -2.05e+76) {
tmp = t_1;
} else if (y <= 102000000000.0) {
tmp = x * Math.exp((a * (-b - z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((y * math.log(z))) tmp = 0 if y <= -2.05e+76: tmp = t_1 elif y <= 102000000000.0: tmp = x * math.exp((a * (-b - z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(y * log(z)))) tmp = 0.0 if (y <= -2.05e+76) tmp = t_1; elseif (y <= 102000000000.0) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((y * log(z))); tmp = 0.0; if (y <= -2.05e+76) tmp = t_1; elseif (y <= 102000000000.0) tmp = x * exp((a * (-b - z))); 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 * N[Log[z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.05e+76], t$95$1, If[LessEqual[y, 102000000000.0], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{y \cdot \log z}\\
\mathbf{if}\;y \leq -2.05 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 102000000000:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.0499999999999999e76 or 1.02e11 < y Initial program 100.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6495.2
Applied rewrites95.2%
Taylor expanded in t around 0
Applied rewrites75.2%
if -2.0499999999999999e76 < y < 1.02e11Initial program 96.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6481.1
Applied rewrites81.1%
Taylor expanded in z around 0
Applied rewrites81.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -2.05e+192)
(* x (exp (* y (- t))))
(if (<= t 4e-36)
(* x (exp (* a (- (- b) z))))
(* x (exp (- (* y (/ (* t t) t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.05e+192) {
tmp = x * exp((y * -t));
} else if (t <= 4e-36) {
tmp = x * exp((a * (-b - z)));
} else {
tmp = x * exp(-(y * ((t * 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 (t <= (-2.05d+192)) then
tmp = x * exp((y * -t))
else if (t <= 4d-36) then
tmp = x * exp((a * (-b - z)))
else
tmp = x * exp(-(y * ((t * 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 (t <= -2.05e+192) {
tmp = x * Math.exp((y * -t));
} else if (t <= 4e-36) {
tmp = x * Math.exp((a * (-b - z)));
} else {
tmp = x * Math.exp(-(y * ((t * t) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.05e+192: tmp = x * math.exp((y * -t)) elif t <= 4e-36: tmp = x * math.exp((a * (-b - z))) else: tmp = x * math.exp(-(y * ((t * t) / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.05e+192) tmp = Float64(x * exp(Float64(y * Float64(-t)))); elseif (t <= 4e-36) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); else tmp = Float64(x * exp(Float64(-Float64(y * Float64(Float64(t * t) / t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.05e+192) tmp = x * exp((y * -t)); elseif (t <= 4e-36) tmp = x * exp((a * (-b - z))); else tmp = x * exp(-(y * ((t * t) / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.05e+192], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e-36], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[(-N[(y * N[(N[(t * t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{+192}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-36}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{-y \cdot \frac{t \cdot t}{t}}\\
\end{array}
\end{array}
if t < -2.05000000000000001e192Initial 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.f6488.4
Applied rewrites88.4%
if -2.05000000000000001e192 < t < 3.9999999999999998e-36Initial program 96.7%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6472.2
Applied rewrites72.2%
Taylor expanded in z around 0
Applied rewrites72.2%
if 3.9999999999999998e-36 < t Initial program 98.7%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6480.6
Applied rewrites80.6%
Applied rewrites81.9%
Final simplification76.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (- t))))))
(if (<= t -2.05e+192)
t_1
(if (<= t 4e-36) (* x (exp (* a (- (- b) z)))) 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 <= -2.05e+192) {
tmp = t_1;
} else if (t <= 4e-36) {
tmp = x * exp((a * (-b - z)));
} 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 <= (-2.05d+192)) then
tmp = t_1
else if (t <= 4d-36) then
tmp = x * exp((a * (-b - z)))
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 <= -2.05e+192) {
tmp = t_1;
} else if (t <= 4e-36) {
tmp = x * Math.exp((a * (-b - z)));
} 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 <= -2.05e+192: tmp = t_1 elif t <= 4e-36: tmp = x * math.exp((a * (-b - z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(y * Float64(-t)))) tmp = 0.0 if (t <= -2.05e+192) tmp = t_1; elseif (t <= 4e-36) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); 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 <= -2.05e+192) tmp = t_1; elseif (t <= 4e-36) tmp = x * exp((a * (-b - z))); 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, -2.05e+192], t$95$1, If[LessEqual[t, 4e-36], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;t \leq -2.05 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-36}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.05000000000000001e192 or 3.9999999999999998e-36 < t Initial program 99.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6482.6
Applied rewrites82.6%
if -2.05000000000000001e192 < t < 3.9999999999999998e-36Initial program 96.7%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6472.2
Applied rewrites72.2%
Taylor expanded in z around 0
Applied rewrites72.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (exp (* y (- t)))))) (if (<= t -2.9e+158) t_1 (if (<= t 4e-36) (* 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 <= -2.9e+158) {
tmp = t_1;
} else if (t <= 4e-36) {
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 <= (-2.9d+158)) then
tmp = t_1
else if (t <= 4d-36) 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 <= -2.9e+158) {
tmp = t_1;
} else if (t <= 4e-36) {
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 <= -2.9e+158: tmp = t_1 elif t <= 4e-36: 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(y * Float64(-t)))) tmp = 0.0 if (t <= -2.9e+158) tmp = t_1; elseif (t <= 4e-36) 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 <= -2.9e+158) tmp = t_1; elseif (t <= 4e-36) 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, -2.9e+158], t$95$1, If[LessEqual[t, 4e-36], 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 \left(-t\right)}\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-36}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.90000000000000024e158 or 3.9999999999999998e-36 < t Initial program 98.2%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6481.3
Applied rewrites81.3%
if -2.90000000000000024e158 < t < 3.9999999999999998e-36Initial program 97.1%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6467.0
Applied rewrites67.0%
Final simplification73.1%
(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(x * Float64(a * Float64(-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 \left(-b\right)\right)
\end{array}
Initial 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 rewrites67.7%
Taylor expanded in y around 0
Applied rewrites24.9%
Taylor expanded in b around inf
Applied rewrites18.9%
Final simplification18.9%
(FPCore (x y z t a b) :precision binary64 (* (- b) (* x a)))
double code(double x, double y, double z, double t, double a, double b) {
return -b * (x * a);
}
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 = -b * (x * a)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return -b * (x * a);
}
def code(x, y, z, t, a, b): return -b * (x * a)
function code(x, y, z, t, a, b) return Float64(Float64(-b) * Float64(x * a)) end
function tmp = code(x, y, z, t, a, b) tmp = -b * (x * a); end
code[x_, y_, z_, t_, a_, b_] := N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-b\right) \cdot \left(x \cdot a\right)
\end{array}
Initial 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 rewrites67.7%
Taylor expanded in y around 0
Applied rewrites24.9%
Taylor expanded in b around inf
Applied rewrites18.9%
Applied rewrites17.0%
Final simplification17.0%
herbie shell --seed 2024222
(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))))))