
(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 9 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) (+ b z) (* (- (log z) t) y)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(-a, (b + z), ((log(z) - t) * y)));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(Float64(-a), Float64(b + z), Float64(Float64(log(z) - t) * y)))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[((-a) * N[(b + z), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(-a, b + z, \left(\log z - t\right) \cdot y\right)}
\end{array}
Initial program 96.5%
Taylor expanded in z around 0
associate-+r+N/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.6
Applied rewrites99.6%
(FPCore (x y z t a b) :precision binary64 (if (<= (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))) 0.998) (/ (* (- t) (* x y)) 1.0) (/ (fma -1.0 (* t (* x y)) x) 1.0)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))) <= 0.998) {
tmp = (-t * (x * y)) / 1.0;
} else {
tmp = fma(-1.0, (t * (x * y)), x) / 1.0;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))) <= 0.998) tmp = Float64(Float64(Float64(-t) * Float64(x * y)) / 1.0); else tmp = Float64(fma(-1.0, Float64(t * Float64(x * y)), x) / 1.0); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[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], 0.998], N[(N[((-t) * N[(x * y), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision], N[(N[(-1.0 * N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] / 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \leq 0.998:\\
\;\;\;\;\frac{\left(-t\right) \cdot \left(x \cdot y\right)}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, t \cdot \left(x \cdot y\right), x\right)}{1}\\
\end{array}
\end{array}
if (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) < 0.998Initial program 96.2%
lift-*.f64N/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
flip-+N/A
sinh-coshN/A
sinh---cosh-revN/A
Applied rewrites99.1%
Taylor expanded in y around 0
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
associate-*r*N/A
exp-prodN/A
Applied rewrites38.0%
Taylor expanded in a around 0
Applied rewrites3.0%
Taylor expanded in t around inf
Applied rewrites19.3%
if 0.998 < (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) Initial program 96.8%
lift-*.f64N/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
flip-+N/A
sinh-coshN/A
sinh---cosh-revN/A
Applied rewrites99.9%
Taylor expanded in y around 0
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
associate-*r*N/A
exp-prodN/A
Applied rewrites64.9%
Taylor expanded in a around 0
Applied rewrites51.1%
Taylor expanded in t around inf
Applied rewrites45.7%
Final simplification35.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.5e+135) (not (<= t 6.6e+139))) (* x (exp (* (- y) t))) (* x (exp (fma (- b) a (* (log z) y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.5e+135) || !(t <= 6.6e+139)) {
tmp = x * exp((-y * t));
} else {
tmp = x * exp(fma(-b, a, (log(z) * y)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.5e+135) || !(t <= 6.6e+139)) tmp = Float64(x * exp(Float64(Float64(-y) * t))); else tmp = Float64(x * exp(fma(Float64(-b), a, Float64(log(z) * y)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.5e+135], N[Not[LessEqual[t, 6.6e+139]], $MachinePrecision]], N[(x * N[Exp[N[((-y) * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-b) * a + N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+135} \lor \neg \left(t \leq 6.6 \cdot 10^{+139}\right):\\
\;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\mathsf{fma}\left(-b, a, \log z \cdot y\right)}\\
\end{array}
\end{array}
if t < -1.5e135 or 6.6000000000000003e139 < t Initial program 97.1%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6488.8
Applied rewrites88.8%
if -1.5e135 < t < 6.6000000000000003e139Initial program 96.4%
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.4
Applied rewrites96.4%
Taylor expanded in t around 0
Applied rewrites90.6%
Final simplification90.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.6e-47) (not (<= y 1.3e-61))) (* (exp (* y (- (log z) t))) x) (* x (exp (* (- b) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.6e-47) || !(y <= 1.3e-61)) {
tmp = exp((y * (log(z) - t))) * x;
} 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 <= (-8.6d-47)) .or. (.not. (y <= 1.3d-61))) then
tmp = exp((y * (log(z) - t))) * x
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 <= -8.6e-47) || !(y <= 1.3e-61)) {
tmp = Math.exp((y * (Math.log(z) - t))) * x;
} else {
tmp = x * Math.exp((-b * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.6e-47) or not (y <= 1.3e-61): tmp = math.exp((y * (math.log(z) - t))) * x else: tmp = x * math.exp((-b * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.6e-47) || !(y <= 1.3e-61)) tmp = Float64(exp(Float64(y * Float64(log(z) - t))) * x); 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 <= -8.6e-47) || ~((y <= 1.3e-61))) tmp = exp((y * (log(z) - t))) * x; else tmp = x * exp((-b * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.6e-47], N[Not[LessEqual[y, 1.3e-61]], $MachinePrecision]], N[(N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.6 \cdot 10^{-47} \lor \neg \left(y \leq 1.3 \cdot 10^{-61}\right):\\
\;\;\;\;e^{y \cdot \left(\log z - t\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\
\end{array}
\end{array}
if y < -8.5999999999999995e-47 or 1.30000000000000005e-61 < y Initial program 96.2%
lift-*.f64N/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
flip-+N/A
sinh-coshN/A
sinh---cosh-revN/A
Applied rewrites99.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6483.6
Applied rewrites83.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-exp.f64N/A
rec-expN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6483.6
Applied rewrites83.6%
if -8.5999999999999995e-47 < y < 1.30000000000000005e-61Initial program 97.1%
Taylor expanded in b around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6489.4
Applied rewrites89.4%
Final simplification85.9%
(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 96.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.3
Applied rewrites97.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.25e+138) (not (<= t 9.2e-71))) (* 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 ((t <= -1.25e+138) || !(t <= 9.2e-71)) {
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 ((t <= (-1.25d+138)) .or. (.not. (t <= 9.2d-71))) 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 ((t <= -1.25e+138) || !(t <= 9.2e-71)) {
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 (t <= -1.25e+138) or not (t <= 9.2e-71): 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 ((t <= -1.25e+138) || !(t <= 9.2e-71)) 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 ((t <= -1.25e+138) || ~((t <= 9.2e-71))) 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[t, -1.25e+138], N[Not[LessEqual[t, 9.2e-71]], $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}\;t \leq -1.25 \cdot 10^{+138} \lor \neg \left(t \leq 9.2 \cdot 10^{-71}\right):\\
\;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\
\end{array}
\end{array}
if t < -1.25000000000000004e138 or 9.1999999999999994e-71 < t Initial program 96.5%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6482.4
Applied rewrites82.4%
if -1.25000000000000004e138 < t < 9.1999999999999994e-71Initial program 96.6%
Taylor expanded in b around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6469.5
Applied rewrites69.5%
Final simplification75.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.8e+64) (/ (fma -1.0 (* t (* x y)) x) 1.0) (* x (exp (* (- z) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.8e+64) {
tmp = fma(-1.0, (t * (x * y)), x) / 1.0;
} else {
tmp = x * exp((-z * a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.8e+64) tmp = Float64(fma(-1.0, Float64(t * Float64(x * y)), x) / 1.0); else tmp = Float64(x * exp(Float64(Float64(-z) * a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.8e+64], N[(N[(-1.0 * N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] / 1.0), $MachinePrecision], N[(x * N[Exp[N[((-z) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+64}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, t \cdot \left(x \cdot y\right), x\right)}{1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-z\right) \cdot a}\\
\end{array}
\end{array}
if y < -4.79999999999999999e64Initial program 98.0%
lift-*.f64N/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
flip-+N/A
sinh-coshN/A
sinh---cosh-revN/A
Applied rewrites100.0%
Taylor expanded in y around 0
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
associate-*r*N/A
exp-prodN/A
Applied rewrites42.8%
Taylor expanded in a around 0
Applied rewrites34.1%
Taylor expanded in t around inf
Applied rewrites27.9%
if -4.79999999999999999e64 < y Initial program 96.2%
Taylor expanded in z around 0
associate-+r+N/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.5
Applied rewrites99.5%
Taylor expanded in z around inf
Applied rewrites41.8%
(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 96.5%
Taylor expanded in b around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6460.8
Applied rewrites60.8%
(FPCore (x y z t a b) :precision binary64 (/ (* (- t) (* x y)) 1.0))
double code(double x, double y, double z, double t, double a, double b) {
return (-t * (x * y)) / 1.0;
}
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 = (-t * (x * y)) / 1.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (-t * (x * y)) / 1.0;
}
def code(x, y, z, t, a, b): return (-t * (x * y)) / 1.0
function code(x, y, z, t, a, b) return Float64(Float64(Float64(-t) * Float64(x * y)) / 1.0) end
function tmp = code(x, y, z, t, a, b) tmp = (-t * (x * y)) / 1.0; end
code[x_, y_, z_, t_, a_, b_] := N[(N[((-t) * N[(x * y), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-t\right) \cdot \left(x \cdot y\right)}{1}
\end{array}
Initial program 96.5%
lift-*.f64N/A
lift-exp.f64N/A
sinh-+-cosh-revN/A
flip-+N/A
sinh-coshN/A
sinh---cosh-revN/A
Applied rewrites99.6%
Taylor expanded in y around 0
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
associate-*r*N/A
exp-prodN/A
Applied rewrites54.3%
Taylor expanded in a around 0
Applied rewrites32.1%
Taylor expanded in t around inf
Applied rewrites16.5%
Final simplification16.5%
herbie shell --seed 2024320
(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))))))