
(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 (* x (exp (fma (- a) (+ z b) (* (- (log z) t) y)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(-a, (z + b), ((log(z) - t) * y)));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(Float64(-a), Float64(z + b), Float64(Float64(log(z) - t) * y)))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(-a, z + b, \left(\log z - t\right) \cdot y\right)}
\end{array}
Initial program 95.7%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-lft-outN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6498.8
Applied rewrites98.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (- (log z) t))))))
(if (<= y -7.2e-37)
t_1
(if (<= y 5e-261)
(* x (exp (* (- (* (- (* -0.5 z) 1.0) z) b) a)))
(if (<= y 3e+132) (* x (exp (fma (- b) a (* (log z) y)))) 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 <= -7.2e-37) {
tmp = t_1;
} else if (y <= 5e-261) {
tmp = x * exp((((((-0.5 * z) - 1.0) * z) - b) * a));
} else if (y <= 3e+132) {
tmp = x * exp(fma(-b, a, (log(z) * y)));
} 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 <= -7.2e-37) tmp = t_1; elseif (y <= 5e-261) tmp = Float64(x * exp(Float64(Float64(Float64(Float64(Float64(-0.5 * z) - 1.0) * z) - b) * a))); elseif (y <= 3e+132) tmp = Float64(x * exp(fma(Float64(-b), a, Float64(log(z) * y)))); else tmp = t_1; end return 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, -7.2e-37], t$95$1, If[LessEqual[y, 5e-261], N[(x * N[Exp[N[(N[(N[(N[(N[(-0.5 * z), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+132], N[(x * N[Exp[N[((-b) * a + N[(N[Log[z], $MachinePrecision] * y), $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 -7.2 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-261}:\\
\;\;\;\;x \cdot e^{\left(\left(-0.5 \cdot z - 1\right) \cdot z - b\right) \cdot a}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+132}:\\
\;\;\;\;x \cdot e^{\mathsf{fma}\left(-b, a, \log z \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.20000000000000014e-37 or 2.9999999999999998e132 < y Initial program 96.1%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-lft-outN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6499.0
Applied rewrites99.0%
Taylor expanded in z around inf
Applied rewrites16.9%
lift-exp.f64N/A
sinh-+-cosh-revN/A
Applied rewrites16.9%
Taylor expanded in a around 0
rec-expN/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-log.f6495.2
Applied rewrites95.2%
if -7.20000000000000014e-37 < y < 4.99999999999999981e-261Initial program 93.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower--.f6487.7
Applied rewrites87.7%
Taylor expanded in z around 0
Applied rewrites94.5%
if 4.99999999999999981e-261 < y < 2.9999999999999998e132Initial program 97.5%
Taylor expanded in z around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6497.6
Applied rewrites97.6%
Taylor expanded in t around 0
Applied rewrites89.2%
Final simplification93.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.2e-37) (not (<= y 3e-15))) (* x (exp (* y (- (log z) t)))) (* x (exp (* (- (* (- (* -0.5 z) 1.0) z) b) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.2e-37) || !(y <= 3e-15)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((((((-0.5 * z) - 1.0) * z) - b) * 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 ((y <= (-7.2d-37)) .or. (.not. (y <= 3d-15))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp(((((((-0.5d0) * z) - 1.0d0) * z) - b) * 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 ((y <= -7.2e-37) || !(y <= 3e-15)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((((((-0.5 * z) - 1.0) * z) - b) * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.2e-37) or not (y <= 3e-15): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((((((-0.5 * z) - 1.0) * z) - b) * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.2e-37) || !(y <= 3e-15)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(Float64(Float64(Float64(Float64(-0.5 * z) - 1.0) * z) - b) * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7.2e-37) || ~((y <= 3e-15))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((((((-0.5 * z) - 1.0) * z) - b) * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.2e-37], N[Not[LessEqual[y, 3e-15]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[(N[(N[(N[(-0.5 * z), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-37} \lor \neg \left(y \leq 3 \cdot 10^{-15}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(\left(-0.5 \cdot z - 1\right) \cdot z - b\right) \cdot a}\\
\end{array}
\end{array}
if y < -7.20000000000000014e-37 or 3e-15 < y Initial program 95.6%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-lft-outN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6497.8
Applied rewrites97.8%
Taylor expanded in z around inf
Applied rewrites16.3%
lift-exp.f64N/A
sinh-+-cosh-revN/A
Applied rewrites16.3%
Taylor expanded in a around 0
rec-expN/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-log.f6489.8
Applied rewrites89.8%
if -7.20000000000000014e-37 < y < 3e-15Initial program 95.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower--.f6488.7
Applied rewrites88.7%
Taylor expanded in z around 0
Applied rewrites92.7%
Final simplification91.2%
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma (- b) a (* (- (log z) t) y)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(-b, a, ((log(z) - t) * y)));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(Float64(-b), a, Float64(Float64(log(z) - t) * y)))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[((-b) * a + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(-b, a, \left(\log z - t\right) \cdot y\right)}
\end{array}
Initial program 95.7%
Taylor expanded in z around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6496.5
Applied rewrites96.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.2e-37) (not (<= y 1950000000000.0))) (* x (exp (* (- y) t))) (* x (exp (* (- (* (- (* -0.5 z) 1.0) z) b) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.2e-37) || !(y <= 1950000000000.0)) {
tmp = x * exp((-y * t));
} else {
tmp = x * exp((((((-0.5 * z) - 1.0) * z) - b) * 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 ((y <= (-7.2d-37)) .or. (.not. (y <= 1950000000000.0d0))) then
tmp = x * exp((-y * t))
else
tmp = x * exp(((((((-0.5d0) * z) - 1.0d0) * z) - b) * 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 ((y <= -7.2e-37) || !(y <= 1950000000000.0)) {
tmp = x * Math.exp((-y * t));
} else {
tmp = x * Math.exp((((((-0.5 * z) - 1.0) * z) - b) * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.2e-37) or not (y <= 1950000000000.0): tmp = x * math.exp((-y * t)) else: tmp = x * math.exp((((((-0.5 * z) - 1.0) * z) - b) * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.2e-37) || !(y <= 1950000000000.0)) tmp = Float64(x * exp(Float64(Float64(-y) * t))); else tmp = Float64(x * exp(Float64(Float64(Float64(Float64(Float64(-0.5 * z) - 1.0) * z) - b) * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7.2e-37) || ~((y <= 1950000000000.0))) tmp = x * exp((-y * t)); else tmp = x * exp((((((-0.5 * z) - 1.0) * z) - b) * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.2e-37], N[Not[LessEqual[y, 1950000000000.0]], $MachinePrecision]], N[(x * N[Exp[N[((-y) * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[(N[(N[(N[(-0.5 * z), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-37} \lor \neg \left(y \leq 1950000000000\right):\\
\;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(\left(-0.5 \cdot z - 1\right) \cdot z - b\right) \cdot a}\\
\end{array}
\end{array}
if y < -7.20000000000000014e-37 or 1.95e12 < y Initial program 95.2%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6462.9
Applied rewrites62.9%
if -7.20000000000000014e-37 < y < 1.95e12Initial program 96.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower--.f6486.3
Applied rewrites86.3%
Taylor expanded in z around 0
Applied rewrites90.1%
Final simplification76.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6e-42) (not (<= y 1950000000000.0))) (* x (exp (* (- y) t))) (* x (exp (* (- b) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6e-42) || !(y <= 1950000000000.0)) {
tmp = x * exp((-y * t));
} else {
tmp = x * exp((-b * 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 ((y <= (-6d-42)) .or. (.not. (y <= 1950000000000.0d0))) then
tmp = x * exp((-y * t))
else
tmp = x * exp((-b * 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 ((y <= -6e-42) || !(y <= 1950000000000.0)) {
tmp = x * Math.exp((-y * t));
} else {
tmp = x * Math.exp((-b * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6e-42) or not (y <= 1950000000000.0): tmp = x * math.exp((-y * t)) else: tmp = x * math.exp((-b * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6e-42) || !(y <= 1950000000000.0)) tmp = Float64(x * exp(Float64(Float64(-y) * t))); else tmp = Float64(x * exp(Float64(Float64(-b) * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6e-42) || ~((y <= 1950000000000.0))) tmp = x * exp((-y * t)); else tmp = x * exp((-b * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6e-42], N[Not[LessEqual[y, 1950000000000.0]], $MachinePrecision]], N[(x * N[Exp[N[((-y) * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-42} \lor \neg \left(y \leq 1950000000000\right):\\
\;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\
\end{array}
\end{array}
if y < -6.00000000000000054e-42 or 1.95e12 < y Initial program 95.2%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6462.9
Applied rewrites62.9%
if -6.00000000000000054e-42 < y < 1.95e12Initial program 96.2%
Taylor expanded in z around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6495.4
Applied rewrites95.4%
Taylor expanded in y around 0
Applied rewrites85.6%
Final simplification74.4%
(FPCore (x y z t a b) :precision binary64 (* x (exp (* (- b) a))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp((-b * 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 = x * exp((-b * a))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp((-b * a));
}
def code(x, y, z, t, a, b): return x * math.exp((-b * a))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(-b) * a))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp((-b * a)); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\left(-b\right) \cdot a}
\end{array}
Initial program 95.7%
Taylor expanded in z around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6496.5
Applied rewrites96.5%
Taylor expanded in y around 0
Applied rewrites62.9%
(FPCore (x y z t a b) :precision binary64 (* x (exp (* (- z) a))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp((-z * 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 = x * exp((-z * a))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp((-z * a));
}
def code(x, y, z, t, a, b): return x * math.exp((-z * a))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(-z) * a))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp((-z * a)); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[((-z) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\left(-z\right) \cdot a}
\end{array}
Initial program 95.7%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-lft-outN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6498.8
Applied rewrites98.8%
Taylor expanded in z around inf
Applied rewrites33.3%
herbie shell --seed 2024337
(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))))))