
(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.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+36)
(- (* y (* x t)))
(if (<= t_1 2e+187)
(fma (* x y) (- t) x)
(if (<= t_1 2e+304) (fma (* x y) (log z) x) (* x (* 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 <= -2e+36) {
tmp = -(y * (x * t));
} else if (t_1 <= 2e+187) {
tmp = fma((x * y), -t, x);
} else if (t_1 <= 2e+304) {
tmp = fma((x * y), log(z), x);
} else {
tmp = x * (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 <= -2e+36) tmp = Float64(-Float64(y * Float64(x * t))); elseif (t_1 <= 2e+187) tmp = fma(Float64(x * y), Float64(-t), x); elseif (t_1 <= 2e+304) tmp = fma(Float64(x * y), log(z), x); else tmp = Float64(x * Float64(y * Float64(-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, -2e+36], (-N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), If[LessEqual[t$95$1, 2e+187], N[(N[(x * y), $MachinePrecision] * (-t) + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+304], N[(N[(x * y), $MachinePrecision] * N[Log[z], $MachinePrecision] + x), $MachinePrecision], N[(x * N[(y * (-t)), $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^{+36}:\\
\;\;\;\;-y \cdot \left(x \cdot t\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+187}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot y, -t, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot y, \log z, x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\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))) < -2.00000000000000008e36Initial program 98.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites41.5%
Taylor expanded in a around 0
Applied rewrites2.6%
Taylor expanded in t around inf
Applied rewrites18.9%
if -2.00000000000000008e36 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 1.99999999999999981e187Initial program 92.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites69.5%
Taylor expanded in a around 0
Applied rewrites54.2%
Taylor expanded in t around inf
Applied rewrites52.9%
if 1.99999999999999981e187 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 1.9999999999999999e304Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites61.3%
Taylor expanded in a around 0
Applied rewrites26.1%
Taylor expanded in t around 0
Applied rewrites25.6%
if 1.9999999999999999e304 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 94.1%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites68.1%
Taylor expanded in a around 0
Applied rewrites43.3%
Taylor expanded in t around inf
Applied rewrites39.9%
Applied rewrites59.5%
Final simplification38.2%
(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+36)
(- (* y (* x t)))
(if (<= t_1 2e+254)
(fma (* x y) (- t) x)
(if (<= t_1 2e+304) (* x (* y (log z))) (* x (* 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 <= -2e+36) {
tmp = -(y * (x * t));
} else if (t_1 <= 2e+254) {
tmp = fma((x * y), -t, x);
} else if (t_1 <= 2e+304) {
tmp = x * (y * log(z));
} else {
tmp = x * (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 <= -2e+36) tmp = Float64(-Float64(y * Float64(x * t))); elseif (t_1 <= 2e+254) tmp = fma(Float64(x * y), Float64(-t), x); elseif (t_1 <= 2e+304) tmp = Float64(x * Float64(y * log(z))); else tmp = Float64(x * Float64(y * Float64(-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, -2e+36], (-N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), If[LessEqual[t$95$1, 2e+254], N[(N[(x * y), $MachinePrecision] * (-t) + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+304], N[(x * N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * (-t)), $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^{+36}:\\
\;\;\;\;-y \cdot \left(x \cdot t\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+254}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot y, -t, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;x \cdot \left(y \cdot \log z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\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))) < -2.00000000000000008e36Initial program 98.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites41.5%
Taylor expanded in a around 0
Applied rewrites2.6%
Taylor expanded in t around inf
Applied rewrites18.9%
if -2.00000000000000008e36 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 1.9999999999999999e254Initial program 94.2%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites67.6%
Taylor expanded in a around 0
Applied rewrites46.9%
Taylor expanded in t around inf
Applied rewrites45.8%
if 1.9999999999999999e254 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 1.9999999999999999e304Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites65.8%
Taylor expanded in a around 0
Applied rewrites45.7%
Taylor expanded in y around inf
Applied rewrites45.7%
Taylor expanded in t around 0
Applied rewrites44.3%
if 1.9999999999999999e304 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 94.1%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites68.1%
Taylor expanded in a around 0
Applied rewrites43.3%
Taylor expanded in t around inf
Applied rewrites39.9%
Applied rewrites59.5%
Final simplification38.2%
(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+36)
(- (* y (* x t)))
(if (<= t_1 2e+304) (fma (* x y) (- t) x) (* x (* 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 <= -2e+36) {
tmp = -(y * (x * t));
} else if (t_1 <= 2e+304) {
tmp = fma((x * y), -t, x);
} else {
tmp = x * (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 <= -2e+36) tmp = Float64(-Float64(y * Float64(x * t))); elseif (t_1 <= 2e+304) tmp = fma(Float64(x * y), Float64(-t), x); else tmp = Float64(x * Float64(y * Float64(-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, -2e+36], (-N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), If[LessEqual[t$95$1, 2e+304], N[(N[(x * y), $MachinePrecision] * (-t) + x), $MachinePrecision], N[(x * N[(y * (-t)), $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^{+36}:\\
\;\;\;\;-y \cdot \left(x \cdot t\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot y, -t, x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\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))) < -2.00000000000000008e36Initial program 98.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites41.5%
Taylor expanded in a around 0
Applied rewrites2.6%
Taylor expanded in t around inf
Applied rewrites18.9%
if -2.00000000000000008e36 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 1.9999999999999999e304Initial program 94.8%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites67.4%
Taylor expanded in a around 0
Applied rewrites46.8%
Taylor expanded in t around inf
Applied rewrites42.0%
if 1.9999999999999999e304 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 94.1%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites68.1%
Taylor expanded in a around 0
Applied rewrites43.3%
Taylor expanded in t around inf
Applied rewrites39.9%
Applied rewrites59.5%
Final simplification36.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+36)
(- (* y (* x t)))
(if (<= t_1 1e+282) (fma (- (* x t)) y x) (* x (* 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 <= -2e+36) {
tmp = -(y * (x * t));
} else if (t_1 <= 1e+282) {
tmp = fma(-(x * t), y, x);
} else {
tmp = x * (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 <= -2e+36) tmp = Float64(-Float64(y * Float64(x * t))); elseif (t_1 <= 1e+282) tmp = fma(Float64(-Float64(x * t)), y, x); else tmp = Float64(x * Float64(y * Float64(-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, -2e+36], (-N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), If[LessEqual[t$95$1, 1e+282], N[((-N[(x * t), $MachinePrecision]) * y + x), $MachinePrecision], N[(x * N[(y * (-t)), $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^{+36}:\\
\;\;\;\;-y \cdot \left(x \cdot t\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+282}:\\
\;\;\;\;\mathsf{fma}\left(-x \cdot t, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\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))) < -2.00000000000000008e36Initial program 98.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites41.5%
Taylor expanded in a around 0
Applied rewrites2.6%
Taylor expanded in t around inf
Applied rewrites18.9%
if -2.00000000000000008e36 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 1.00000000000000003e282Initial program 94.5%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites66.3%
Taylor expanded in a around 0
Applied rewrites46.1%
Applied rewrites44.0%
Taylor expanded in t around inf
Applied rewrites39.9%
if 1.00000000000000003e282 < (+.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 y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites71.2%
Taylor expanded in a around 0
Applied rewrites45.9%
Taylor expanded in t around inf
Applied rewrites33.3%
Applied rewrites49.6%
Final simplification34.2%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) 1e+303) (* t (* y (- x))) (* x (* y (- t)))))
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+303) {
tmp = t * (y * -x);
} else {
tmp = x * (y * -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 * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))) <= 1d+303) then
tmp = t * (y * -x)
else
tmp = x * (y * -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 * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))) <= 1e+303) {
tmp = t * (y * -x);
} else {
tmp = x * (y * -t);
}
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+303: tmp = t * (y * -x) else: tmp = x * (y * -t) 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+303) tmp = Float64(t * Float64(y * Float64(-x))); else tmp = Float64(x * Float64(y * Float64(-t))); 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+303) tmp = t * (y * -x); else tmp = x * (y * -t); 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+303], N[(t * N[(y * (-x)), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * (-t)), $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 10^{+303}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\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))) < 1e303Initial program 96.4%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites56.8%
Taylor expanded in a around 0
Applied rewrites29.2%
Applied rewrites28.0%
Taylor expanded in t around inf
Applied rewrites15.1%
if 1e303 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 94.3%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites69.0%
Taylor expanded in a around 0
Applied rewrites42.1%
Taylor expanded in t around inf
Applied rewrites38.8%
Applied rewrites57.9%
Final simplification21.0%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) -2e+147) (- (* y (* x t))) (* x (* y (- t)))))
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))) <= -2e+147) {
tmp = -(y * (x * t));
} else {
tmp = x * (y * -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 * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))) <= (-2d+147)) then
tmp = -(y * (x * t))
else
tmp = x * (y * -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 * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))) <= -2e+147) {
tmp = -(y * (x * t));
} else {
tmp = x * (y * -t);
}
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))) <= -2e+147: tmp = -(y * (x * t)) else: tmp = x * (y * -t) 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))) <= -2e+147) tmp = Float64(-Float64(y * Float64(x * t))); else tmp = Float64(x * Float64(y * Float64(-t))); 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))) <= -2e+147) tmp = -(y * (x * t)); else tmp = x * (y * -t); 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], -2e+147], (-N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), N[(x * N[(y * (-t)), $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 -2 \cdot 10^{+147}:\\
\;\;\;\;-y \cdot \left(x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\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))) < -2e147Initial program 98.5%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites32.4%
Taylor expanded in a around 0
Applied rewrites2.4%
Taylor expanded in t around inf
Applied rewrites18.2%
if -2e147 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 95.3%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites67.7%
Taylor expanded in a around 0
Applied rewrites41.1%
Taylor expanded in t around inf
Applied rewrites17.1%
Applied rewrites21.7%
Final simplification20.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (- (log z) t))))))
(if (<= y -1.55e-19)
t_1
(if (<= y 8.4e-13) (* x (exp (- (* a (+ z b))))) 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 <= -1.55e-19) {
tmp = t_1;
} else if (y <= 8.4e-13) {
tmp = x * exp(-(a * (z + 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 * (log(z) - t)))
if (y <= (-1.55d-19)) then
tmp = t_1
else if (y <= 8.4d-13) then
tmp = x * exp(-(a * (z + 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 * (Math.log(z) - t)));
double tmp;
if (y <= -1.55e-19) {
tmp = t_1;
} else if (y <= 8.4e-13) {
tmp = x * Math.exp(-(a * (z + b)));
} 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 <= -1.55e-19: tmp = t_1 elif y <= 8.4e-13: tmp = x * math.exp(-(a * (z + b))) 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 <= -1.55e-19) tmp = t_1; elseif (y <= 8.4e-13) tmp = Float64(x * exp(Float64(-Float64(a * Float64(z + b))))); 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 <= -1.55e-19) tmp = t_1; elseif (y <= 8.4e-13) tmp = x * exp(-(a * (z + 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 * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.55e-19], t$95$1, If[LessEqual[y, 8.4e-13], N[(x * N[Exp[(-N[(a * N[(z + b), $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 -1.55 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{-13}:\\
\;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.5499999999999999e-19 or 8.39999999999999955e-13 < y Initial program 96.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6491.6
Applied rewrites91.6%
if -1.5499999999999999e-19 < y < 8.39999999999999955e-13Initial program 95.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6489.2
Applied rewrites89.2%
Taylor expanded in z around 0
Applied rewrites89.2%
Final simplification90.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (exp (* y (- t)))))) (if (<= t -246.0) t_1 (if (<= t 1.65e-38) (* x (exp (* y (log 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 <= -246.0) {
tmp = t_1;
} else if (t <= 1.65e-38) {
tmp = x * exp((y * log(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 <= (-246.0d0)) then
tmp = t_1
else if (t <= 1.65d-38) then
tmp = x * exp((y * log(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 <= -246.0) {
tmp = t_1;
} else if (t <= 1.65e-38) {
tmp = x * Math.exp((y * Math.log(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 <= -246.0: tmp = t_1 elif t <= 1.65e-38: tmp = x * math.exp((y * math.log(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 <= -246.0) tmp = t_1; elseif (t <= 1.65e-38) tmp = Float64(x * exp(Float64(y * log(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 <= -246.0) tmp = t_1; elseif (t <= 1.65e-38) tmp = x * exp((y * log(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, -246.0], t$95$1, If[LessEqual[t, 1.65e-38], N[(x * N[Exp[N[(y * N[Log[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 -246:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-38}:\\
\;\;\;\;x \cdot e^{y \cdot \log z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -246 or 1.6500000000000001e-38 < t Initial program 95.3%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6484.1
Applied rewrites84.1%
if -246 < t < 1.6500000000000001e-38Initial program 96.9%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6475.2
Applied rewrites75.2%
Taylor expanded in t around 0
Applied rewrites75.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (- t))))))
(if (<= t -2300.0)
t_1
(if (<= t 2.2e+33) (* x (exp (- (* a (+ z 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 <= -2300.0) {
tmp = t_1;
} else if (t <= 2.2e+33) {
tmp = x * exp(-(a * (z + 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 <= (-2300.0d0)) then
tmp = t_1
else if (t <= 2.2d+33) then
tmp = x * exp(-(a * (z + 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 <= -2300.0) {
tmp = t_1;
} else if (t <= 2.2e+33) {
tmp = x * Math.exp(-(a * (z + 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 <= -2300.0: tmp = t_1 elif t <= 2.2e+33: tmp = x * math.exp(-(a * (z + 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 <= -2300.0) tmp = t_1; elseif (t <= 2.2e+33) tmp = Float64(x * exp(Float64(-Float64(a * Float64(z + 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 <= -2300.0) tmp = t_1; elseif (t <= 2.2e+33) tmp = x * exp(-(a * (z + 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, -2300.0], t$95$1, If[LessEqual[t, 2.2e+33], N[(x * N[Exp[(-N[(a * N[(z + b), $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 -2300:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+33}:\\
\;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2300 or 2.19999999999999994e33 < t Initial program 94.9%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6486.7
Applied rewrites86.7%
if -2300 < t < 2.19999999999999994e33Initial program 97.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6467.3
Applied rewrites67.3%
Taylor expanded in z around 0
Applied rewrites67.3%
Final simplification76.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (exp (* y (- t)))))) (if (<= t -530.0) t_1 (if (<= t 1.4e+30) (* 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 <= -530.0) {
tmp = t_1;
} else if (t <= 1.4e+30) {
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 <= (-530.0d0)) then
tmp = t_1
else if (t <= 1.4d+30) 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 <= -530.0) {
tmp = t_1;
} else if (t <= 1.4e+30) {
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 <= -530.0: tmp = t_1 elif t <= 1.4e+30: 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 <= -530.0) tmp = t_1; elseif (t <= 1.4e+30) 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 <= -530.0) tmp = t_1; elseif (t <= 1.4e+30) 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, -530.0], t$95$1, If[LessEqual[t, 1.4e+30], 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 -530:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+30}:\\
\;\;\;\;x \cdot e^{-a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -530 or 1.39999999999999992e30 < t Initial program 94.9%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6486.7
Applied rewrites86.7%
if -530 < t < 1.39999999999999992e30Initial program 97.2%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6464.4
Applied rewrites64.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.65e+121) (* x (* y (log z))) (if (<= y 0.34) (* x (exp (- (* z a)))) (* x (* y (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.65e+121) {
tmp = x * (y * log(z));
} else if (y <= 0.34) {
tmp = x * exp(-(z * a));
} else {
tmp = x * (y * -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.65d+121)) then
tmp = x * (y * log(z))
else if (y <= 0.34d0) then
tmp = x * exp(-(z * a))
else
tmp = x * (y * -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.65e+121) {
tmp = x * (y * Math.log(z));
} else if (y <= 0.34) {
tmp = x * Math.exp(-(z * a));
} else {
tmp = x * (y * -t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.65e+121: tmp = x * (y * math.log(z)) elif y <= 0.34: tmp = x * math.exp(-(z * a)) else: tmp = x * (y * -t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.65e+121) tmp = Float64(x * Float64(y * log(z))); elseif (y <= 0.34) tmp = Float64(x * exp(Float64(-Float64(z * a)))); else tmp = Float64(x * Float64(y * Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.65e+121) tmp = x * (y * log(z)); elseif (y <= 0.34) tmp = x * exp(-(z * a)); else tmp = x * (y * -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.65e+121], N[(x * N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.34], N[(x * N[Exp[(-N[(z * a), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+121}:\\
\;\;\;\;x \cdot \left(y \cdot \log z\right)\\
\mathbf{elif}\;y \leq 0.34:\\
\;\;\;\;x \cdot e^{-z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\
\end{array}
\end{array}
if y < -1.6499999999999999e121Initial program 96.5%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites40.0%
Taylor expanded in a around 0
Applied rewrites33.6%
Taylor expanded in y around inf
Applied rewrites35.1%
Taylor expanded in t around 0
Applied rewrites25.3%
if -1.6499999999999999e121 < y < 0.340000000000000024Initial program 95.1%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6478.3
Applied rewrites78.3%
Taylor expanded in z around 0
Applied rewrites78.3%
Taylor expanded in b around 0
Applied rewrites53.1%
if 0.340000000000000024 < y Initial program 98.3%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites38.7%
Taylor expanded in a around 0
Applied rewrites15.8%
Taylor expanded in t around inf
Applied rewrites27.6%
Applied rewrites28.9%
Final simplification41.3%
(FPCore (x y z t a b) :precision binary64 (if (<= z 4.2e-49) (* x (exp (- (* a b)))) (* x (exp (- (* z a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 4.2e-49) {
tmp = x * exp(-(a * b));
} else {
tmp = x * exp(-(z * a));
}
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 (z <= 4.2d-49) then
tmp = x * exp(-(a * b))
else
tmp = x * exp(-(z * a))
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 (z <= 4.2e-49) {
tmp = x * Math.exp(-(a * b));
} else {
tmp = x * Math.exp(-(z * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 4.2e-49: tmp = x * math.exp(-(a * b)) else: tmp = x * math.exp(-(z * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 4.2e-49) tmp = Float64(x * exp(Float64(-Float64(a * b)))); else tmp = Float64(x * exp(Float64(-Float64(z * a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 4.2e-49) tmp = x * exp(-(a * b)); else tmp = x * exp(-(z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 4.2e-49], N[(x * N[Exp[(-N[(a * b), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[(-N[(z * a), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.2 \cdot 10^{-49}:\\
\;\;\;\;x \cdot e^{-a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{-z \cdot a}\\
\end{array}
\end{array}
if z < 4.1999999999999998e-49Initial program 97.3%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6456.4
Applied rewrites56.4%
if 4.1999999999999998e-49 < z Initial program 88.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6456.7
Applied rewrites56.7%
Taylor expanded in z around 0
Applied rewrites56.7%
Taylor expanded in b around 0
Applied rewrites56.8%
Final simplification56.4%
(FPCore (x y z t a b) :precision binary64 (- (* y (* x t))))
double code(double x, double y, double z, double t, double a, double b) {
return -(y * (x * t));
}
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 = -(y * (x * t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return -(y * (x * t));
}
def code(x, y, z, t, a, b): return -(y * (x * t))
function code(x, y, z, t, a, b) return Float64(-Float64(y * Float64(x * t))) end
function tmp = code(x, y, z, t, a, b) tmp = -(y * (x * t)); end
code[x_, y_, z_, t_, a_, b_] := (-N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision])
\begin{array}{l}
\\
-y \cdot \left(x \cdot t\right)
\end{array}
Initial program 96.1%
Taylor expanded in y around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites58.5%
Taylor expanded in a around 0
Applied rewrites31.0%
Taylor expanded in t around inf
Applied rewrites17.4%
Final simplification17.4%
herbie shell --seed 2024221
(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))))))