
(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 8 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 (* (exp (fma (- a) b (* (- (log z) t) y))) x))
double code(double x, double y, double z, double t, double a, double b) {
return exp(fma(-a, b, ((log(z) - t) * y))) * x;
}
function code(x, y, z, t, a, b) return Float64(exp(fma(Float64(-a), b, Float64(Float64(log(z) - t) * y))) * x) end
code[x_, y_, z_, t_, a_, b_] := N[(N[Exp[N[((-a) * b + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
e^{\mathsf{fma}\left(-a, b, \left(\log z - t\right) \cdot y\right)} \cdot x
\end{array}
Initial program 98.4%
Taylor expanded in z around 0
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6499.2
Applied rewrites99.2%
Final simplification99.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (exp (* (- t) y)) x)))
(if (<= t -5.4e+54)
t_1
(if (<= t 1.4e+137) (* (exp (fma (- a) b (* (log z) y))) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((-t * y)) * x;
double tmp;
if (t <= -5.4e+54) {
tmp = t_1;
} else if (t <= 1.4e+137) {
tmp = exp(fma(-a, b, (log(z) * y))) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(-t) * y)) * x) tmp = 0.0 if (t <= -5.4e+54) tmp = t_1; elseif (t <= 1.4e+137) tmp = Float64(exp(fma(Float64(-a), b, Float64(log(z) * y))) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -5.4e+54], t$95$1, If[LessEqual[t, 1.4e+137], N[(N[Exp[N[((-a) * b + N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(-t\right) \cdot y} \cdot x\\
\mathbf{if}\;t \leq -5.4 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+137}:\\
\;\;\;\;e^{\mathsf{fma}\left(-a, b, \log z \cdot y\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.40000000000000022e54 or 1.4e137 < t Initial program 97.6%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6487.7
Applied rewrites87.7%
if -5.40000000000000022e54 < t < 1.4e137Initial program 98.8%
Taylor expanded in z around 0
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6498.8
Applied rewrites98.8%
Taylor expanded in t around 0
Applied rewrites98.2%
Final simplification94.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (exp (* (- (log z) t) y)) x)))
(if (<= y -4.8e+39)
t_1
(if (<= y 1.4e-90) (* (exp (* (- (- b) z) a)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(((log(z) - t) * y)) * x;
double tmp;
if (y <= -4.8e+39) {
tmp = t_1;
} else if (y <= 1.4e-90) {
tmp = exp(((-b - z) * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = exp(((log(z) - t) * y)) * x
if (y <= (-4.8d+39)) then
tmp = t_1
else if (y <= 1.4d-90) then
tmp = exp(((-b - z) * a)) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.exp(((Math.log(z) - t) * y)) * x;
double tmp;
if (y <= -4.8e+39) {
tmp = t_1;
} else if (y <= 1.4e-90) {
tmp = Math.exp(((-b - z) * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(((math.log(z) - t) * y)) * x tmp = 0 if y <= -4.8e+39: tmp = t_1 elif y <= 1.4e-90: tmp = math.exp(((-b - z) * a)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(log(z) - t) * y)) * x) tmp = 0.0 if (y <= -4.8e+39) tmp = t_1; elseif (y <= 1.4e-90) tmp = Float64(exp(Float64(Float64(Float64(-b) - z) * a)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(((log(z) - t) * y)) * x; tmp = 0.0; if (y <= -4.8e+39) tmp = t_1; elseif (y <= 1.4e-90) tmp = exp(((-b - z) * a)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -4.8e+39], t$95$1, If[LessEqual[y, 1.4e-90], N[(N[Exp[N[(N[((-b) - z), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(\log z - t\right) \cdot y} \cdot x\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-90}:\\
\;\;\;\;e^{\left(\left(-b\right) - z\right) \cdot a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.8000000000000002e39 or 1.3999999999999999e-90 < y Initial program 97.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6488.0
Applied rewrites88.0%
if -4.8000000000000002e39 < y < 1.3999999999999999e-90Initial program 99.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6491.5
Applied rewrites91.5%
Taylor expanded in z around 0
Applied rewrites91.5%
Final simplification89.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (exp (* (log z) y)) x)))
(if (<= y -6.5e+39)
t_1
(if (<= y 1.45e+76) (* (exp (* (- (- b) z) a)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((log(z) * y)) * x;
double tmp;
if (y <= -6.5e+39) {
tmp = t_1;
} else if (y <= 1.45e+76) {
tmp = exp(((-b - z) * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = exp((log(z) * y)) * x
if (y <= (-6.5d+39)) then
tmp = t_1
else if (y <= 1.45d+76) then
tmp = exp(((-b - z) * a)) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.exp((Math.log(z) * y)) * x;
double tmp;
if (y <= -6.5e+39) {
tmp = t_1;
} else if (y <= 1.45e+76) {
tmp = Math.exp(((-b - z) * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((math.log(z) * y)) * x tmp = 0 if y <= -6.5e+39: tmp = t_1 elif y <= 1.45e+76: tmp = math.exp(((-b - z) * a)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(log(z) * y)) * x) tmp = 0.0 if (y <= -6.5e+39) tmp = t_1; elseif (y <= 1.45e+76) tmp = Float64(exp(Float64(Float64(Float64(-b) - z) * a)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((log(z) * y)) * x; tmp = 0.0; if (y <= -6.5e+39) tmp = t_1; elseif (y <= 1.45e+76) tmp = exp(((-b - z) * a)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -6.5e+39], t$95$1, If[LessEqual[y, 1.45e+76], N[(N[Exp[N[(N[((-b) - z), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\log z \cdot y} \cdot x\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+76}:\\
\;\;\;\;e^{\left(\left(-b\right) - z\right) \cdot a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.5000000000000001e39 or 1.4500000000000001e76 < y Initial program 97.0%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6495.1
Applied rewrites95.1%
Taylor expanded in t around 0
Applied rewrites73.4%
if -6.5000000000000001e39 < y < 1.4500000000000001e76Initial program 99.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6484.8
Applied rewrites84.8%
Taylor expanded in z around 0
Applied rewrites84.8%
Final simplification80.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (exp (* (- t) y)) x)))
(if (<= y -5e+39)
t_1
(if (<= y 1.4e-90) (* (exp (* (- (- b) z) a)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((-t * y)) * x;
double tmp;
if (y <= -5e+39) {
tmp = t_1;
} else if (y <= 1.4e-90) {
tmp = exp(((-b - z) * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = exp((-t * y)) * x
if (y <= (-5d+39)) then
tmp = t_1
else if (y <= 1.4d-90) then
tmp = exp(((-b - z) * a)) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.exp((-t * y)) * x;
double tmp;
if (y <= -5e+39) {
tmp = t_1;
} else if (y <= 1.4e-90) {
tmp = Math.exp(((-b - z) * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((-t * y)) * x tmp = 0 if y <= -5e+39: tmp = t_1 elif y <= 1.4e-90: tmp = math.exp(((-b - z) * a)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(-t) * y)) * x) tmp = 0.0 if (y <= -5e+39) tmp = t_1; elseif (y <= 1.4e-90) tmp = Float64(exp(Float64(Float64(Float64(-b) - z) * a)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((-t * y)) * x; tmp = 0.0; if (y <= -5e+39) tmp = t_1; elseif (y <= 1.4e-90) tmp = exp(((-b - z) * a)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -5e+39], t$95$1, If[LessEqual[y, 1.4e-90], N[(N[Exp[N[(N[((-b) - z), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(-t\right) \cdot y} \cdot x\\
\mathbf{if}\;y \leq -5 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-90}:\\
\;\;\;\;e^{\left(\left(-b\right) - z\right) \cdot a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.00000000000000015e39 or 1.3999999999999999e-90 < y Initial program 97.8%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6464.8
Applied rewrites64.8%
if -5.00000000000000015e39 < y < 1.3999999999999999e-90Initial program 99.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6491.5
Applied rewrites91.5%
Taylor expanded in z around 0
Applied rewrites91.5%
Final simplification77.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (exp (* (- t) y)) x))) (if (<= y -5e+39) t_1 (if (<= y 1.4e-90) (* (exp (* (- b) a)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((-t * y)) * x;
double tmp;
if (y <= -5e+39) {
tmp = t_1;
} else if (y <= 1.4e-90) {
tmp = exp((-b * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = exp((-t * y)) * x
if (y <= (-5d+39)) then
tmp = t_1
else if (y <= 1.4d-90) then
tmp = exp((-b * a)) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.exp((-t * y)) * x;
double tmp;
if (y <= -5e+39) {
tmp = t_1;
} else if (y <= 1.4e-90) {
tmp = Math.exp((-b * a)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((-t * y)) * x tmp = 0 if y <= -5e+39: tmp = t_1 elif y <= 1.4e-90: tmp = math.exp((-b * a)) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(-t) * y)) * x) tmp = 0.0 if (y <= -5e+39) tmp = t_1; elseif (y <= 1.4e-90) tmp = Float64(exp(Float64(Float64(-b) * a)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((-t * y)) * x; tmp = 0.0; if (y <= -5e+39) tmp = t_1; elseif (y <= 1.4e-90) tmp = exp((-b * a)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -5e+39], t$95$1, If[LessEqual[y, 1.4e-90], N[(N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(-t\right) \cdot y} \cdot x\\
\mathbf{if}\;y \leq -5 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-90}:\\
\;\;\;\;e^{\left(-b\right) \cdot a} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.00000000000000015e39 or 1.3999999999999999e-90 < y Initial program 97.8%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6464.8
Applied rewrites64.8%
if -5.00000000000000015e39 < y < 1.3999999999999999e-90Initial program 99.2%
Taylor expanded in b around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6489.0
Applied rewrites89.0%
Final simplification76.0%
(FPCore (x y z t a b) :precision binary64 (* (exp (* (- b) a)) x))
double code(double x, double y, double z, double t, double a, double b) {
return exp((-b * a)) * x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = exp((-b * a)) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return Math.exp((-b * a)) * x;
}
def code(x, y, z, t, a, b): return math.exp((-b * a)) * x
function code(x, y, z, t, a, b) return Float64(exp(Float64(Float64(-b) * a)) * x) end
function tmp = code(x, y, z, t, a, b) tmp = exp((-b * a)) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
e^{\left(-b\right) \cdot a} \cdot x
\end{array}
Initial program 98.4%
Taylor expanded in b around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6460.2
Applied rewrites60.2%
Final simplification60.2%
(FPCore (x y z t a b) :precision binary64 (* (exp (* a z)) x))
double code(double x, double y, double z, double t, double a, double b) {
return exp((a * z)) * x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = exp((a * z)) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return Math.exp((a * z)) * x;
}
def code(x, y, z, t, a, b): return math.exp((a * z)) * x
function code(x, y, z, t, a, b) return Float64(exp(Float64(a * z)) * x) end
function tmp = code(x, y, z, t, a, b) tmp = exp((a * z)) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[Exp[N[(a * z), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
e^{a \cdot z} \cdot x
\end{array}
Initial program 98.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6461.6
Applied rewrites61.6%
Taylor expanded in z around 0
Applied rewrites61.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.6
Applied rewrites63.2%
Taylor expanded in b around 0
Applied rewrites30.4%
Final simplification30.4%
herbie shell --seed 2024235
(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))))))